Skip to content
Snippets Groups Projects
Commit 493d6f2e authored by Wolf Noble's avatar Wolf Noble :wolf:
Browse files

:bug: :lipstick: fix #13

parent 7180b668
No related branches found
Tags 2.74.3
No related merge requests found
......@@ -4,7 +4,7 @@
{{- $size := default "regular" (.Get "size" | lower) -}}
{{- $icon := default "" (.Get "icon") -}}
{{- $title := default "" (.Get "title") -}}
{{- if not (in (slice "small" "regular" "large") $size) -}}
{{- if not (in (slice "small" "regular" "large" "xlarge" "2xlarge") $size) -}}
{{- $size = "regular" -}}
{{- end -}}
{{- if not (.Parent.Scratch.Get $group) }}
......
......@@ -10,25 +10,29 @@
{{- $itchyBox.Set "sizeDecorations" "text-xxs min-w-0" -}}
{{- else if eq "large" $box.Size -}}
{{- $itchyBox.Set "sizeDecorations" "text-base min-w-20" -}}
{{- else if eq "xlarge" $box.Size -}}
{{- $itchyBox.Set "sizeDecorations" "text-base min-w-20" -}}
{{- else if eq "2xlarge" $box.Size -}}
{{- $itchyBox.Set "sizeDecorations" "text-base min-w-20" -}}
{{- else -}}
{{- $itchyBox.Set "sizeDecorations" "text-sm min-w-15" -}}
{{- end -}}
{{- $sizeClass := $itchyBox.Get "sizeDecorations" -}}
<div class="rounded-lg p-2 m-2 group boxybox group-hover:ring-3 group-hover:border-dotted {{ $sizeClass }}{{ with $box.Class }}{{ printf " %s " . }}{{ end }}" >
<div class="rounded-lg p-2 m-2 group boxybox {{ $sizeClass }}{{ with $box.Class }}{{ printf " %s " . }}{{ end }}" >
{{- if or $box.Title $box.Icon -}}
<div class="group bg-gradient-to-br from-primary-400 dark:from-slate-800 from-15% via-slate-300 dark:via-slate-600 via-50% to-slate-500 dark:to-slate-800 to-70% text-black dark:text-white drop-shadow-lg flex content-center rounded-t-lg justify-center break-words {{ $sizeClass -}} ">
<div class="group shadow-xl bg-gradient-to-br from-primary-400 dark:from-slate-800 from-15% via-slate-300 dark:via-slate-600 via-50% to-slate-500 dark:to-slate-800 to-70% text-black dark:text-white drop-shadow-lg flex content-center rounded-t-lg justify-center break-words {{ $sizeClass -}} ">
{{- with $box.Icon -}}
{{- $icon := resources.Get (printf "icons/%s.svg" ($box.Icon)) -}}
{{- with $icon -}}
<span class="relative inline-block align-text-bottom icon"> {{ $icon.Content | safeHTML }} </span>
<span class="px-1 mt-1 relative inline-block align-text-bottom icon"> {{ $icon.Content | safeHTML }} </span>
{{- else }}
{{ warnf `[boxes] "icon" error in "%s": Resource "%s" not found. Check the path is correct or remove the invocation.` $box.Icon (printf "icons/%s.svg" ($.Get 0)) }}
{{ end }}
{{- end }}
{{- with $box.Title }}<span>{{ . }}</span>{{ end }}
{{- with $box.Title }}<span class=" pr-2" >{{ . }}</span>{{ end }}
</div>
{{- end }}
<div class="group flex p-2 m-0 text-black dark:text-slate-400 content-center outline-slate-400 outline-1 bg-gradient-to-br from-slate-400 dark:from-slate-800 from-10% via-secondary-600 dark:via-secondary-900 to-slate-600 dark:to-slate-800 rounded-b-lg justify-center {{ $sizeClass -}} "><span class="filter-none">
<div class="border border-0 border-t-2 border-t-slate-500 dark:border-t-black/20 group flex p-2 m-0 text-black dark:text-slate-400 content-center outline-slate-400 outline-1 bg-gradient-to-br from-slate-400 dark:from-slate-800 from-10% via-secondary-600 dark:via-secondary-900 to-slate-600 dark:to-slate-800 rounded-b-lg justify-center {{ $sizeClass -}} "><span class="filter-none">
{{- .Content | $.Page.RenderString }}
{{/*
this works instead of $.Page.RenderString for some other types of content. prolly need to add a box param to toggle behavior?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment