feat(theme): unified typography config + defineTheme API cleanup - #804
Merged
Conversation
Restructures defineTheme to unify font, scale, and weight config: - typeScale → typography.scale - fonts (URLs) → typography.body/heading/code (with url field) - font token overrides → typography roles (family + fallbacks) - typeScale.weights → typography.heading.weight/weights - motionScale → motion - radiusScale → radius Typography roles: - body, heading, code each declare family, fallbacks, url, weight - heading inherits family/fallbacks/url from body if omitted - FontWeight type: 'normal' | 'medium' | 'semibold' | 'bold' (+ escape hatch) - defineTheme derives --font-body/heading/code tokens and fonts[] for loading Theme updates: - default: typeScale → typography.scale, motionScale → motion - neutral: font tokens moved into typography roles, weights into heading role - brutalist: typography.body sets Courier for both body+heading, removes redundant --font-heading token and text.base.fontFamily override CLI updates: - build-theme passes new keys to defineTheme - Font warnings derived from resolvedTheme.fonts (typography roles) - Doc files updated No backwards compatibility shim — clean break. Co-authored-by: Navi <navi@navibot.dev>
cixzhang
force-pushed
the
navi/feat/theme-api-cleanup
branch
from
March 21, 2026 17:14
52466d9 to
cb4fe77
Compare
The variable was const-scoped inside the if block but referenced outside it for font declaration warnings. Co-authored-by: Navi <navi@navibot.dev>
Contributor
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. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
rubyycheung
added a commit
that referenced
this pull request
Mar 22, 2026
Migrate to the unified defineTheme API from #803/#804: - typeScale → typography.scale + typography roles (body/code) Fonts now declared via typography config instead of raw --font-* tokens - motionScale → motion - variants: string[] → Record<string, styles> Custom button variant styles moved from components into variants (declaration + styles together) - CLI: fix generateVariantDeclarations to handle new object-style variants alongside legacy array format
Merged
cixzhang
added a commit
that referenced
this pull request
Apr 26, 2026
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #802 — restructures
defineThemeto unify font, scale, and weight config under a singletypographyobject, and renamesmotionScale/radiusScaletomotion/radius.API Changes
typeScale: { base, ratio }typography: { scale: { base, ratio } }typeScale.weights.headingtypography.heading: { weight, weights }fonts: [{ family, url }]typography.body: { family, fallbacks, url }tokens: { '--font-body': '...' }typography.body: { family, fallbacks }motionScale: { fast, medium, ratio }motion: { fast, medium, ratio }radiusScale: { base, multiplier }radius: { base, multiplier }Typography roles
body,heading,code— each declares family, fallbacks, url, weightheadinginherits family/fallbacks/url frombodyif omittedFontWeighttype:'normal' | 'medium' | 'semibold' | 'bold'(raw CSS values as escape hatch)defineThemederives--font-body/heading/codetokens andfonts[]for runtime loadingTheme updates
Default — minimal change:
Neutral — fonts move from token overrides into typography roles:
Brutalist —
typography.bodysets Courier for everything (heading inherits), eliminates both the--font-headingtoken override and thetext.base.fontFamilycomponent override:Test coverage
Closes #802.