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>
21 lines
515 B
Go
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()
|
|
}
|