themes-scifi-clean/button_override.templ
Alex Dunmow 96b87b3e81 initial: theme plugin scifi-clean
Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously
an unversioned directory inside ~/src/blockninja-themes/scifi-clean.

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

28 lines
923 B
Plaintext

package main
// scifiButtonComponent renders the Sci-Fi Clean button. The `→` chevron is a
// literal U+2192 inside an explicit data-icon span so UAT §13.14 can grep
// for it deterministically.
templ scifiButtonComponent(text, url, variant string) {
<a
href={ templ.SafeURL(safeHref(url)) }
class={ "scifi-mono uppercase tracking-widest text-xs px-5 py-3 scifi-focus inline-flex items-center justify-center gap-2", buttonVariantClass(variant) }
style="font-family: var(--font-mono);"
>
<span>{ text }</span>
<span data-icon="chevron-right" aria-hidden="true">{ "→" }</span>
</a>
}
// buttonVariantClass picks the visual treatment.
func buttonVariantClass(variant string) string {
switch variant {
case "outline":
return "hairline text-foreground bg-transparent"
case "destructive":
return "bg-destructive text-destructive-foreground"
default:
return "bg-primary text-primary-foreground"
}
}