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>
37 lines
1.1 KiB
Plaintext
37 lines
1.1 KiB
Plaintext
package main
|
|
|
|
// buttonVariantStyle returns inline style overrides per variant.
|
|
func buttonVariantStyle(variant string) string {
|
|
switch variant {
|
|
case "secondary":
|
|
return "background-color: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); border-color: hsl(var(--primary));"
|
|
case "ghost":
|
|
return "background-color: transparent; color: hsl(var(--foreground)); border-color: hsl(var(--primary));"
|
|
default:
|
|
return "background-color: hsl(var(--foreground)); color: hsl(var(--background)); border-color: hsl(var(--primary));"
|
|
}
|
|
}
|
|
|
|
// artDecoButtonComponent renders the black-pill button with stamped hover state.
|
|
templ artDecoButtonComponent(data ButtonOverrideData) {
|
|
if data.URL != "" {
|
|
<a
|
|
data-block-override="art-deco:button"
|
|
href={ templ.SafeURL(data.URL) }
|
|
class="deco-pill inline-block"
|
|
style={ buttonVariantStyle(data.Variant) }
|
|
>
|
|
{ data.Label }
|
|
</a>
|
|
} else {
|
|
<button
|
|
type="button"
|
|
data-block-override="art-deco:button"
|
|
class="deco-pill"
|
|
style={ buttonVariantStyle(data.Variant) }
|
|
>
|
|
{ data.Label }
|
|
</button>
|
|
}
|
|
}
|