themes-corporate-modernist/card_override.go
Alex Dunmow 4713787bbd initial: theme plugin corporate-modernist
Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously
an unversioned directory inside ~/src/blockninja-themes/corporate-modernist.

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

23 lines
642 B
Go

package main
import (
"bytes"
"context"
)
// CorporateModernistCardBlock renders the built-in `card` block with a flat
// surface, hairline border, no elevation, and an optional accent top rule.
// Content shape: {"title":"...","body":"...","accent": true|false}.
func CorporateModernistCardBlock(ctx context.Context, content map[string]any) string {
title := getString(content, "title")
body := getString(content, "body")
if body == "" {
body = getString(content, "text")
}
accent := getBool(content, "accent", false)
var buf bytes.Buffer
_ = cardOverrideComponent(title, body, accent).Render(ctx, &buf)
return buf.String()
}