summaryrefslogtreecommitdiff
path: root/layouts/_markup
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-09-23 10:33:07 +0800
committerEltrac <hi@guhub.cn>2025-09-23 10:33:07 +0800
commitd251a4e3f670325569bb0ac5d4943b437c8a89bb (patch)
tree26e69bd74856aa59d7a2f0c06afe782f581bb811 /layouts/_markup
parent50058e19df7f7c34cedd921970a405233055b534 (diff)
refactor: size headings based on container font-size
Diffstat (limited to 'layouts/_markup')
-rw-r--r--layouts/_markup/render-heading.html15
1 files changed, 10 insertions, 5 deletions
diff --git a/layouts/_markup/render-heading.html b/layouts/_markup/render-heading.html
index 7b076fed..52b2f3ff 100644
--- a/layouts/_markup/render-heading.html
+++ b/layouts/_markup/render-heading.html
@@ -1,7 +1,12 @@
-{{ $size := index (dict "1" "text-4xl" "2" "text-2xl my-8" "3" "text-xl" "4" "text-lg" "5" "text-base" "6" "text-sm") (printf "%d" .Level) }}
-<h{{ .Level }} id="{{ .Anchor }}"
- class="{{ if eq .Level 2 }}font-extrabold{{ else }}font-bold{{ end }}
- {{ $size }}
- {{ with .Attributes.class }} {{ . }}{{ end }}">
+{{ $size := index (dict
+ "1" "text-[1.5em] font-extrabold"
+ "2" "text-[1.25em] font-extrabold"
+ "3" "text-[1.125em] font-bold"
+ "4" "text-[1em] font-bold"
+ "5" "text-[0.9em] font-bold"
+ "6" "text-[0.875em]") (printf "%d" .Level) }}
+<h{{ .Level }}
+ id="{{ .Anchor }}"
+ class="{{ $size }} {{ with .Attributes.class }} {{ . }}{{ end }}">
{{- .Text -}}
</h{{ .Level }}>