themes-brutalist/button_override.go
Alex Dunmow 771a286fa9 initial: theme plugin brutalist
Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously
an unversioned directory inside ~/src/blockninja-themes/brutalist.

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

21 lines
515 B
Go

package main
import (
"bytes"
"context"
)
// BrutalistButtonBlock applies square corners, 1px solid ink border,
// hover inverts to accent fill — per the spec block-overrides section.
func BrutalistButtonBlock(ctx context.Context, content map[string]any) string {
text := getString(content, "text")
href := getString(content, "href")
if href == "" {
href = getString(content, "url")
}
var buf bytes.Buffer
_ = brutalistButtonComponent(text, resolveURL(href)).Render(ctx, &buf)
return buf.String()
}