feat(theme): add theme-local token support - #5844
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Visual RegressionStatus: Skipped — Broad stable scope is deferred to the daily release gate. It covers 4332 trusted baseline shots instead of recapturing them for this PR. View the report Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
cixzhang
left a comment
There was a problem hiding this comment.
Theme authors who opt into localTokens can currently receive invalid or contradictory output even though the build succeeds.
CSS_VAR_PATTERNonly recognizes lowercasevar(. Valid CSS such asVAR(--astryx-theme-foo-color-fill)bypasses undeclared-reference and cycle validation, so an enrolled static build can emit a broken reference. Please parse the function case-insensitively and add runtime/static undeclared + cycle regressions for uppercase/mixed-case spelling.- A key duplicated in legacy
tokensandlocalTokensis accepted and emitted twice. CSS uses the later local declaration, whileresolveThemeToken()reads the portabletokensvalue. Please reject cross-map duplicate names before output and test CSS/helper parity. - This is a settled implementation of AST-006, so the implementation PR also needs to update the canonical shipped records required by AST-006’s current-state impact and completion criteria: AST-006’s phase plus
theme-authoring-contract,theme-compilation, andtheme-tokens. The Neutral theme record is not involved because this PR adds infrastructure without an adopted Neutral local-token mapping.
|
Addressed the requested changes in
Local validation passed: 218 focused tests, Core build/typecheck, CLI strict/authoring/template-doc typechecks, Neutral build, ESLint, and |
cixzhang
left a comment
There was a problem hiding this comment.
Thanks, this addresses the validation and contract-sync issues from my prior review. No new concerns.
[Reviewed by Robohands]
Summary
localTokensauthoring contract from docs(knowledge): specify theme-local tokens #5801tokensbehaviorScope
This is infrastructure only. It does not adopt local tokens in Neutral or change any shipped theme colors or component styling. Neutral adoption remains separate from the cross-theme API review.
An inheritance-only descendant keeps its existing theme name, including legacy names that are not lower-kebab-case. The stricter name rule applies only when a theme explicitly supplies
localTokens.Validation
pnpm -F @astryxdesign/core buildpnpm -F @astryxdesign/core typecheckpnpm -F @astryxdesign/theme-neutral buildpnpm -F @astryxdesign/cli typecheck:strictpnpm -F @astryxdesign/cli typecheck:authoringpnpm -F @astryxdesign/cli typecheck:template-docspnpm check:syncpnpm check:changesetspnpm check:package-boundariesExtracted from #5752 so the reusable API can be reviewed independently from Neutral's visual design decisions.