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

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

24 lines
737 B
Plaintext

package main
// coffeeButtonVariantClass appends a variant-specific tone to the kraft-tag.
func coffeeButtonVariantClass(variant string) string {
switch variant {
case "secondary":
return "bg-secondary text-secondary-foreground"
case "destructive":
return "bg-destructive text-destructive-foreground"
default:
return ""
}
}
// coffeeButtonComponent renders a button or link styled like a kraft tag with
// a slight rotation on hover.
templ coffeeButtonComponent(text, url, variant string) {
if url != "" {
<a href={ templ.SafeURL(url) } class={ "kraft-tag", coffeeButtonVariantClass(variant) }>{ text }</a>
} else {
<button type="button" class={ "kraft-tag", coffeeButtonVariantClass(variant) }>{ text }</button>
}
}