blowfish/layouts/shortcodes/alert.html

40 lines
1.1 KiB
HTML
Raw Permalink Normal View History

2023-01-27 17:07:45 -06:00
{{ if .IsNamedParams }}
{{ $.Scratch.Set "icon" (default "triangle-exclamation" (.Get "icon") ) }}
2023-02-03 14:45:41 -06:00
{{ $.Scratch.Set "cardColor" (.Get "cardColor") }}
{{ $.Scratch.Set "iconColor" (.Get "iconColor") }}
{{ $.Scratch.Set "textColor" (.Get "textColor") }}
2023-01-25 07:34:35 -06:00
{{ else }}
2023-01-27 17:07:45 -06:00
{{ $.Scratch.Set "icon" (default "triangle-exclamation" (.Get 0) ) }}
2023-01-25 07:34:35 -06:00
{{ end }}
2023-01-27 17:07:45 -06:00
<div
2023-02-03 14:45:41 -06:00
{{ if not ($.Scratch.Get "cardColor") }}
2023-01-27 17:07:45 -06:00
class="flex px-4 py-3 rounded-md bg-primary-100 dark:bg-primary-900"
2023-01-25 07:34:35 -06:00
{{ else }}
2023-01-27 17:07:45 -06:00
class="flex px-4 py-3 rounded-md"
style="background-color: {{ $.Scratch.Get "cardColor" }}"
{{ end }}>
<span
2023-02-03 14:45:41 -06:00
{{ if not ($.Scratch.Get "iconColor") }}
2023-01-27 17:07:45 -06:00
class="text-primary-400 ltr:pr-3 rtl:pl-3 flex items-center"
{{ else }}
class="ltr:pr-3 rtl:pl-3 flex items-center"
style="color: {{ $.Scratch.Get "iconColor" }}"
{{ end }}>
{{ partial "icon.html" ($.Scratch.Get "icon") }}
2022-09-10 14:05:37 -05:00
</span>
2023-01-25 07:34:35 -06:00
2023-01-27 17:07:45 -06:00
<span
2023-02-03 14:45:41 -06:00
{{ if not ($.Scratch.Get "textColor") }}
2023-01-27 17:07:45 -06:00
class="dark:text-neutral-300"
{{ else }}
style="color: {{ $.Scratch.Get "textColor" }}"
{{ end }}>
2022-09-10 14:05:37 -05:00
{{- .Inner | markdownify -}}
</span>
</div>