Skip to content

Give Button variant: "primary" a visual identity via ButtonPrimary slots #58

Description

@joestump-agent

Part of #54. Depends on the token-set expansion (#56).

Problem

renderButton (render/button.go:39-41) acts only on borderless; primary is explicitly ignored with the documented rationale (render/button.go:14-20) that monochrome leaves no free attribute — bold is the base style and reverse-video is reserved for focus.

That rationale is correct for the default styles but dissolves once hosts can inject color: a themed host (crush mapping its accent color) has an obvious way to distinguish the main call-to-action, and the A2UI basic catalog explicitly defines primary as "the main call-to-action button".

Fix

  • Route Variant == "primary" through the new ButtonPrimary / ButtonPrimaryFocused slots from Expand render.Styles into a complete token set (component slots + Glyphs) #56.
  • DefaultStyles() sets ButtonPrimary = Button and ButtonPrimaryFocused = ButtonFocused, so monochrome output is byte-identical to today — the distinction only appears when a host overrides the slots.
  • Update the rationale comment in render/button.go to describe the new mechanism.
  • Test: default render unchanged for a primary button; with an overridden ButtonPrimary, primary and default buttons render differently and focus still uses the focused variant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions