diff options
| author | Danilo M. <danix@danix.xyz> | 2026-04-29 15:53:55 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-04-29 15:53:55 +0200 |
| commit | 2167e0cc09afdba7c0cc893ea7399e8345d9596f (patch) | |
| tree | c31726e92232d82907a70bb05cfd6b33fe2cd7ab /layouts/shortcodes/callout.html | |
| parent | 865218999f53fd030004a60c42109334d032c451 (diff) | |
| download | danixxyz-theme-2167e0cc09afdba7c0cc893ea7399e8345d9596f.tar.gz danixxyz-theme-2167e0cc09afdba7c0cc893ea7399e8345d9596f.zip | |
feat: add callout shortcode (note/tip/info/warning/danger/success)
- Single shortcode with type param, CSS-only variants
- Left border + fading bottom border (::after gradient)
- Colors mapped to existing theme tokens (--accent, --accent2, --type-link, --type-life)
- --callout-danger: #ef4444 hardcoded exception (approved)
- role=alert for danger, role=note for all others (WCAG AA)
- aria-hidden on Feather icons, title overridable via param
- EN/IT i18n keys
Also fixes html.theme-light CSS vars to match THEMING-STANDARD.md:
- --bg, --bg2, --surface, --border, --text, --text-dim, --muted
- --accent (#7c3aed), --accent2 (#008f5a)
Diffstat (limited to 'layouts/shortcodes/callout.html')
| -rw-r--r-- | layouts/shortcodes/callout.html | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/layouts/shortcodes/callout.html b/layouts/shortcodes/callout.html new file mode 100644 index 0000000..b492267 --- /dev/null +++ b/layouts/shortcodes/callout.html @@ -0,0 +1,15 @@ +{{- $type := .Get "type" | default "note" -}} +{{- $title := .Get "title" | default (i18n (printf "callout_%s" $type)) -}} +{{- $role := cond (eq $type "danger") "alert" "note" -}} +{{- $icons := dict "note" "edit-2" "tip" "zap" "info" "info" "warning" "alert-triangle" "danger" "x-circle" "success" "check-circle" -}} +{{- $icon := index $icons $type | default "info" -}} + +<div class="callout callout-{{ $type }}" role="{{ $role }}"> + <div class="callout-title"> + <i data-feather="{{ $icon }}" class="w-3.5 h-3.5" aria-hidden="true"></i> + <span>{{ $title }}</span> + </div> + <div class="callout-body"> + {{- .Inner | markdownify -}} + </div> +</div> |
