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

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

70 lines
2.6 KiB
Plaintext

package main
// headingSizeClass returns the responsive size utility for a given heading level.
func headingSizeClass(level int) string {
switch level {
case 1:
return "text-4xl md:text-5xl"
case 2:
return "text-3xl md:text-4xl"
case 3:
return "text-2xl md:text-3xl"
case 4:
return "text-xl md:text-2xl"
case 5:
return "text-lg md:text-xl"
case 6:
return "text-base md:text-lg"
default:
return "text-3xl md:text-4xl"
}
}
// artDecoHeadingComponent renders an Art Deco heading with caps tracking and hairline gold underline.
templ artDecoHeadingComponent(data HeadingData) {
switch data.Level {
case 1:
<h1
data-block-override="art-deco:heading"
class={ "deco-caps deco-underline", headingSizeClass(1), data.ExtraCls }
style="font-family: var(--font-heading, &quot;Italiana&quot;, &quot;Cinzel&quot;, Georgia, serif); color: hsl(var(--foreground));"
>{ data.Text }</h1>
case 2:
<h2
data-block-override="art-deco:heading"
class={ "deco-caps deco-underline", headingSizeClass(2), data.ExtraCls }
style="font-family: var(--font-heading, &quot;Italiana&quot;, &quot;Cinzel&quot;, Georgia, serif); color: hsl(var(--foreground));"
>{ data.Text }</h2>
case 3:
<h3
data-block-override="art-deco:heading"
class={ "deco-caps deco-underline", headingSizeClass(3), data.ExtraCls }
style="font-family: var(--font-heading, &quot;Italiana&quot;, &quot;Cinzel&quot;, Georgia, serif); color: hsl(var(--foreground));"
>{ data.Text }</h3>
case 4:
<h4
data-block-override="art-deco:heading"
class={ "deco-caps deco-underline", headingSizeClass(4), data.ExtraCls }
style="font-family: var(--font-heading, &quot;Italiana&quot;, &quot;Cinzel&quot;, Georgia, serif); color: hsl(var(--foreground));"
>{ data.Text }</h4>
case 5:
<h5
data-block-override="art-deco:heading"
class={ "deco-caps deco-underline", headingSizeClass(5), data.ExtraCls }
style="font-family: var(--font-heading, &quot;Italiana&quot;, &quot;Cinzel&quot;, Georgia, serif); color: hsl(var(--foreground));"
>{ data.Text }</h5>
case 6:
<h6
data-block-override="art-deco:heading"
class={ "deco-caps deco-underline", headingSizeClass(6), data.ExtraCls }
style="font-family: var(--font-heading, &quot;Italiana&quot;, &quot;Cinzel&quot;, Georgia, serif); color: hsl(var(--foreground));"
>{ data.Text }</h6>
default:
<h2
data-block-override="art-deco:heading"
class={ "deco-caps deco-underline", headingSizeClass(2), data.ExtraCls }
style="font-family: var(--font-heading, &quot;Italiana&quot;, &quot;Cinzel&quot;, Georgia, serif); color: hsl(var(--foreground));"
>{ data.Text }</h2>
}
}