mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 15:31:52 +00:00
Merge pull request #484 from mirceanton/feature-483-custom-alert
✨ Custom colors for alert shortcode
This commit is contained in:
@@ -1,8 +1,42 @@
|
||||
<div class="flex px-4 py-3 rounded-md bg-primary-100 dark:bg-primary-900">
|
||||
<span class="text-primary-400 ltr:pr-3 rtl:pl-3 flex items-center">
|
||||
{{ partial "icon.html" (.Get 0 | default "triangle-exclamation") }}
|
||||
{{ if .IsNamedParams }}
|
||||
{{ $.Scratch.Set "icon" (default "triangle-exclamation" (.Get "icon") ) }}
|
||||
{{ $.Scratch.Set "cardColor" (default "NULL" (.Get "cardColor") ) }}
|
||||
{{ $.Scratch.Set "iconColor" (default "NULL" (.Get "iconColor") ) }}
|
||||
{{ $.Scratch.Set "textColor" (default "NULL" (.Get "textColor") ) }}
|
||||
{{ else }}
|
||||
{{ $.Scratch.Set "icon" (default "triangle-exclamation" (.Get 0) ) }}
|
||||
{{ $.Scratch.Set "cardColor" "NULL" }}
|
||||
{{ $.Scratch.Set "iconColor" "NULL" }}
|
||||
{{ $.Scratch.Set "textColor" "NULL" }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<div
|
||||
{{ if eq ($.Scratch.Get "cardColor") "NULL" }}
|
||||
class="flex px-4 py-3 rounded-md bg-primary-100 dark:bg-primary-900"
|
||||
{{ else }}
|
||||
class="flex px-4 py-3 rounded-md"
|
||||
style="background-color: {{ $.Scratch.Get "cardColor" }}"
|
||||
{{ end }}>
|
||||
|
||||
<span
|
||||
{{ if eq ($.Scratch.Get "iconColor") "NULL" }}
|
||||
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") }}
|
||||
</span>
|
||||
<span class="dark:text-neutral-300">
|
||||
|
||||
<span
|
||||
{{ if eq ($.Scratch.Get "textColor") "NULL" }}
|
||||
class="dark:text-neutral-300"
|
||||
{{ else }}
|
||||
style="color: {{ $.Scratch.Get "textColor" }}"
|
||||
{{ end }}>
|
||||
|
||||
{{- .Inner | markdownify -}}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user