Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously an unversioned directory inside ~/src/blockninja-themes/corporate-modernist. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
58 lines
1.9 KiB
Plaintext
58 lines
1.9 KiB
Plaintext
package main
|
|
|
|
// headingOverrideComponent renders the Corporate Modernist heading override.
|
|
// All levels share the .cm-heading base; H2 picks up the accent underline.
|
|
templ headingOverrideComponent(level int, text, textClass string) {
|
|
switch level {
|
|
case 1:
|
|
<h1 class={ "cm-heading", headingOverrideSizeClass(1), textClass } style="font-size: clamp(2rem, 4vw, 3rem); line-height: 1.1;">
|
|
{ text }
|
|
</h1>
|
|
case 2:
|
|
<h2 class={ "cm-heading", headingOverrideSizeClass(2), textClass } style="font-size: clamp(1.5rem, 3vw, 2.25rem); line-height: 1.2;">
|
|
<span class="cm-heading-h2-accent">{ text }</span>
|
|
</h2>
|
|
case 3:
|
|
<h3 class={ "cm-heading", headingOverrideSizeClass(3), textClass } style="font-size: 1.5rem; line-height: 1.3;">
|
|
{ text }
|
|
</h3>
|
|
case 4:
|
|
<h4 class={ "cm-heading", headingOverrideSizeClass(4), textClass } style="font-size: 1.25rem; line-height: 1.3;">
|
|
{ text }
|
|
</h4>
|
|
case 5:
|
|
<h5 class={ "cm-heading", headingOverrideSizeClass(5), textClass } style="font-size: 1.125rem; line-height: 1.4;">
|
|
{ text }
|
|
</h5>
|
|
case 6:
|
|
<h6 class={ "cm-heading", headingOverrideSizeClass(6), textClass } style="font-size: 1rem; line-height: 1.4;">
|
|
{ text }
|
|
</h6>
|
|
default:
|
|
<h2 class={ "cm-heading", headingOverrideSizeClass(2), textClass } style="font-size: clamp(1.5rem, 3vw, 2.25rem); line-height: 1.2;">
|
|
<span class="cm-heading-h2-accent">{ text }</span>
|
|
</h2>
|
|
}
|
|
}
|
|
|
|
// headingOverrideSizeClass keeps the Tailwind-style size hooks predictable for
|
|
// downstream tooling without baking sizes into hardcoded classes.
|
|
func headingOverrideSizeClass(level int) string {
|
|
switch level {
|
|
case 1:
|
|
return "cm-heading-h1"
|
|
case 2:
|
|
return "cm-heading-h2"
|
|
case 3:
|
|
return "cm-heading-h3"
|
|
case 4:
|
|
return "cm-heading-h4"
|
|
case 5:
|
|
return "cm-heading-h5"
|
|
case 6:
|
|
return "cm-heading-h6"
|
|
default:
|
|
return "cm-heading-h2"
|
|
}
|
|
}
|