42 lines
1.3 KiB
Plaintext
42 lines
1.3 KiB
Plaintext
package main
|
|
|
|
// gothamHeadingBaseClass returns default Tailwind classes for each heading level.
|
|
func gothamHeadingBaseClass(level int) string {
|
|
switch level {
|
|
case 1:
|
|
return "text-4xl font-bold tracking-tight"
|
|
case 2:
|
|
return "text-3xl font-semibold tracking-tight"
|
|
case 3:
|
|
return "text-2xl font-semibold"
|
|
case 4:
|
|
return "text-xl font-semibold"
|
|
case 5:
|
|
return "text-lg font-medium"
|
|
case 6:
|
|
return "text-base font-medium"
|
|
default:
|
|
return "text-3xl font-semibold tracking-tight"
|
|
}
|
|
}
|
|
|
|
// gothamHeadingComponent renders a heading with Gotham accent styling.
|
|
templ gothamHeadingComponent(level int, text, textClass string) {
|
|
switch level {
|
|
case 1:
|
|
<h1 class={ gothamHeadingBaseClass(1), "text-accent", textClass }>{ text }</h1>
|
|
case 2:
|
|
<h2 class={ gothamHeadingBaseClass(2), "text-accent", textClass }>{ text }</h2>
|
|
case 3:
|
|
<h3 class={ gothamHeadingBaseClass(3), "text-accent", textClass }>{ text }</h3>
|
|
case 4:
|
|
<h4 class={ gothamHeadingBaseClass(4), "text-accent", textClass }>{ text }</h4>
|
|
case 5:
|
|
<h5 class={ gothamHeadingBaseClass(5), "text-accent", textClass }>{ text }</h5>
|
|
case 6:
|
|
<h6 class={ gothamHeadingBaseClass(6), "text-accent", textClass }>{ text }</h6>
|
|
default:
|
|
<h2 class={ gothamHeadingBaseClass(2), "text-accent", textClass }>{ text }</h2>
|
|
}
|
|
}
|