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

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

16 lines
665 B
Plaintext

package main
// editorialButtonComponent renders an editorial-styled button. The element is
// always <button> (UAT §13.11 measures computed style on <button>); when a URL
// is supplied a same-element wrapper anchor is emitted around the button so
// the existing tab order and keyboard semantics remain intact.
templ editorialButtonComponent(text, url, ariaLabel string) {
if url != "" {
<a href={ templ.SafeURL(linkHref(url)) } class="inline-block" aria-label={ ariaLabel }>
<button type="button" class="editorial-button">{ text }</button>
</a>
} else {
<button type="button" class="editorial-button" aria-label={ ariaLabel }>{ text }</button>
}
}