Skip to content

feat(chat): a2ui internal token system + catalog refactor (Pass 2b)#234

Merged
blove merged 1 commit into
mainfrom
claude/a2ui-internal-token-system
May 10, 2026
Merged

feat(chat): a2ui internal token system + catalog refactor (Pass 2b)#234
blove merged 1 commit into
mainfrom
claude/a2ui-internal-token-system

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 10, 2026

Summary

  • Declares ~50 --a2ui-* CSS custom properties at :host on <a2ui-surface>, covering spacing (7-step 4px scale), typography (h1–h5, body, caption, label), shape radius, focus ring, motion duration/easing, elevation (box-shadow), and a full color palette with dark-theme defaults
  • Refactors 14 of the 18 catalog components to consume var(--a2ui-*) instead of hardcoded px/color values — same visual design, now driven by tokens
  • --a2ui-primary continues to be agent-overridable via the existing [style.--a2ui-primary]="primaryColor()" host binding from beginRendering.styles.primaryColor; the token default (#4f8df5) applies when the agent omits it
  • Legacy back-compat tokens (--a2ui-card-bg, --a2ui-input-bg, --a2ui-input-text, --a2ui-label, --a2ui-caption, --a2ui-border) are preserved as aliases onto the new semantic tokens
  • 4 layout-only components (audio-player, column, row, icon) have no token-eligible values in their styles: blocks and are intentionally unchanged

Components touched (14 refactored)

button, card, text, text-field, modal, slider, check-box, multiple-choice, tabs, divider, image, video, list, date-time-input

Unchanged (no token-eligible CSS)

audio-player, column, row, icon

Pass 3 path

Pass 3 will ship preset CSS files (e.g. a Material flavor) that consumers @import to override these :host defaults with light-theme or branded palettes.

Test plan

  • npx nx run-many -t test,lint,build -p a2ui,chat --skip-nx-cache — all green
  • Open http://localhost:4200/embed, click each GenUI welcome suggestion, verify surface renders correctly with new token system

🤖 Generated with Claude Code

Declare ~50 --a2ui-* tokens at :host on <a2ui-surface> covering spacing,
typography, shape, focus ring, motion, elevation, and color scales with
dark-theme defaults. Refactor 14 catalog components (button, card, text,
text-field, modal, slider, check-box, multiple-choice, tabs, divider,
image, video, list, date-time-input) to consume var(--a2ui-*) instead of
hardcoded values. The --a2ui-primary host binding (agent-overridable via
beginRendering.styles.primaryColor) is preserved. Four layout-only
components (audio-player, column, row, icon) carry no token-eligible
values and are intentionally unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cacheplane Ready Ready Preview, Comment May 10, 2026 3:21pm

Request Review

@blove blove merged commit 7c32407 into main May 10, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant