themes-earthen/heading_override.templ
Alex Dunmow 49401f1b41 initial: theme plugin earthen
Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously
an unversioned directory inside ~/src/blockninja-themes/earthen.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-06 14:11:27 +08:00

77 lines
2.4 KiB
Plaintext

package main
// earthenHeadingBaseClass returns base classes for each heading level.
func earthenHeadingBaseClass(level int) string {
switch level {
case 1:
return "earthen-h1 text-5xl md:text-6xl font-semibold tracking-tight leading-tight"
case 2:
return "earthen-h2 text-3xl md:text-4xl font-semibold leading-snug crayon-underline"
case 3:
return "earthen-h3 text-2xl md:text-3xl font-semibold leading-snug"
case 4:
return "earthen-h4 text-xl md:text-2xl font-semibold"
case 5:
return "earthen-h5 text-lg font-semibold"
case 6:
return "earthen-h6 text-base font-semibold uppercase tracking-wider"
default:
return "earthen-h2 text-3xl md:text-4xl font-semibold"
}
}
// earthenHeadingComponent renders a heading with Earthen styling.
templ earthenHeadingComponent(level int, text, textClass string) {
switch level {
case 1:
<h1
class={ earthenHeadingBaseClass(1), textClass }
style={ "font-family: var(--font-heading, \"Fraunces\", \"Playfair Display\", Georgia, serif); color: hsl(var(--primary));" }
>
{ text }
</h1>
case 2:
<h2
class={ earthenHeadingBaseClass(2), textClass }
style={ "font-family: var(--font-heading, \"Fraunces\", \"Playfair Display\", Georgia, serif); color: hsl(var(--primary));" }
>
{ text }
</h2>
case 3:
<h3
class={ earthenHeadingBaseClass(3), textClass }
style={ "font-family: var(--font-heading, \"Fraunces\", \"Playfair Display\", Georgia, serif); color: hsl(var(--foreground));" }
>
{ text }
</h3>
case 4:
<h4
class={ earthenHeadingBaseClass(4), textClass }
style={ "font-family: var(--font-heading, \"Fraunces\", \"Playfair Display\", Georgia, serif); color: hsl(var(--foreground));" }
>
{ text }
</h4>
case 5:
<h5
class={ earthenHeadingBaseClass(5), textClass }
style={ "font-family: var(--font-heading, \"Fraunces\", \"Playfair Display\", Georgia, serif); color: hsl(var(--foreground));" }
>
{ text }
</h5>
case 6:
<h6
class={ earthenHeadingBaseClass(6), textClass }
style={ "font-family: var(--font-heading, \"Fraunces\", \"Playfair Display\", Georgia, serif); color: hsl(var(--muted-foreground));" }
>
{ text }
</h6>
default:
<h2
class={ earthenHeadingBaseClass(2), textClass }
style={ "font-family: var(--font-heading, \"Fraunces\", \"Playfair Display\", Georgia, serif); color: hsl(var(--primary));" }
>
{ text }
</h2>
}
}