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

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

39 lines
2.2 KiB
Plaintext

package main
func brutalistHeadingStyle(level int) string {
switch level {
case 1:
return "font-family: var(--font-heading, 'Space Grotesk', 'Inter Tight', sans-serif); font-weight: 700; font-size: clamp(2.5rem, 6vw, 5rem); line-height: 0.9; letter-spacing: -0.03em; text-transform: uppercase; color: hsl(var(--foreground)); margin: 0;"
case 2:
return "font-family: var(--font-heading, 'Space Grotesk', 'Inter Tight', sans-serif); font-weight: 700; font-size: clamp(1.875rem, 4vw, 3rem); line-height: 0.95; letter-spacing: -0.02em; text-transform: uppercase; color: hsl(var(--foreground)); margin: 0;"
case 3:
return "font-family: var(--font-heading, 'Space Grotesk', sans-serif); font-weight: 700; font-size: 1.5rem; line-height: 1; letter-spacing: -0.015em; color: hsl(var(--foreground)); margin: 0;"
case 4:
return "font-family: var(--font-heading, 'Space Grotesk', sans-serif); font-weight: 600; font-size: 1.25rem; line-height: 1.1; letter-spacing: -0.01em; color: hsl(var(--foreground)); margin: 0;"
case 5:
return "font-family: var(--font-heading, 'Space Grotesk', sans-serif); font-weight: 600; font-size: 1.125rem; line-height: 1.15; color: hsl(var(--foreground)); margin: 0;"
case 6:
return "font-family: var(--font-heading, 'Space Grotesk', sans-serif); font-weight: 600; font-size: 1rem; line-height: 1.2; color: hsl(var(--foreground)); margin: 0;"
}
return "font-family: var(--font-heading, 'Space Grotesk', sans-serif); font-weight: 700; color: hsl(var(--foreground)); margin: 0;"
}
templ brutalistHeadingComponent(level int, text, textClass string) {
switch level {
case 1:
<h1 class={ textClass } style={ brutalistHeadingStyle(1) }>{ text }</h1>
case 2:
<h2 class={ textClass } style={ brutalistHeadingStyle(2) }>{ text }</h2>
case 3:
<h3 class={ textClass } style={ brutalistHeadingStyle(3) }>{ text }</h3>
case 4:
<h4 class={ textClass } style={ brutalistHeadingStyle(4) }>{ text }</h4>
case 5:
<h5 class={ textClass } style={ brutalistHeadingStyle(5) }>{ text }</h5>
case 6:
<h6 class={ textClass } style={ brutalistHeadingStyle(6) }>{ text }</h6>
default:
<h2 class={ textClass } style={ brutalistHeadingStyle(2) }>{ text }</h2>
}
}