Skip to content

Commit 24af351

Browse files
committed
Callout: Add feather support to mf loud callouts
1 parent 267aa23 commit 24af351

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

assets/css/v2/style.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,9 @@ blockquote.caution {
11571157
background-color: oklch(var(--color-callout-caution-shadow));
11581158
border-bottom: 1px solid oklch(var(--color-callout-caution-primary));
11591159
}
1160+
.call-out-type .feather {
1161+
color: oklch(var(--color-callout-caution-primary));
1162+
}
11601163
}
11611164

11621165
blockquote.warning {
@@ -1167,6 +1170,9 @@ blockquote.warning {
11671170
background-color: oklch(var(--color-callout-warning-shadow));
11681171
border-bottom: 1px solid oklch(var(--color-callout-warning-primary));
11691172
}
1173+
.call-out-type .feather {
1174+
color: oklch(var(--color-callout-warning-primary));
1175+
}
11701176
}
11711177

11721178
blockquote.important {

layouts/partials/callout.html

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,24 @@
3535

3636
{{/* Render a different block, if "loud" callouts are used */}}
3737
{{ $specialTitles := slice "Caution" "Warning" "Deprecated" "Important" }}
38+
{{ $specialTitleIcons := dict
39+
"Caution" "alert-triangle"
40+
"Warning" "alert-octagon"
41+
"Deprecated" "alert-octagon"
42+
"Important" "arrow-right-circle"
43+
}}
44+
{{ $icon := index $specialTitleIcons $title | default "" }}
45+
3846
{{ $isSpecialTitle := in $specialTitles $title }}
3947
{{ if $isSpecialTitle }}
4048
{{/* Loud callouts */}}
4149
<blockquote class="{{ $class }}" data-mf="true" style="display: none;">
4250
<div>
43-
{{ with $icon }}
44-
<i class="{{ . }}"></i>
45-
{{ end }}
4651
<div class="call-out-type">
52+
{{ partial "feather" (dict "context" . "icon" $icon) .}}
4753
{{ $title }}
4854
</div>
49-
<div class="special-content">
55+
<div>
5056
{{ .content | markdownify }}
5157
</div>
5258
</div>

layouts/shortcodes/call-out.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{{</call-out>}}
77

88
Backwards compatibility usage:
9-
{{<call-out "warning" "Custom title""fa fa-check-circle" "true">}}
9+
{{<call-out "warning" "Custom title" "fa fa-check-circle" "true">}}
1010
This callout uses the icon check-circle. **This should be an inline callout.**
1111
{{</call-out>}}
1212

0 commit comments

Comments
 (0)