Skip to content

refactor: rename design tokens to match new naming convention - #894

Merged
rubyycheung merged 17 commits into
mainfrom
navi/feat/token-renames
Mar 26, 2026
Merged

rubyycheung merged 17 commits into
mainfrom
navi/feat/token-renames

Conversation

@rubyycheung

@rubyycheung rubyycheung commented Mar 26, 2026 •

Copy link
Copy Markdown
Contributor

Token Renames

Renames all design tokens based on the token spec.

~150 files changed. All renames are name-only — no values were changed.

Summary

Action Sheet Count PR Status
Renamed 99 ✅ 99/99
Removed 12 ✅ 12/12
New 8 ✅ 8/8
Unchanged 75 —

Rename Table (99 tokens — names only, all values unchanged)

Category Old Token New Token
Core Semantic --color-secondary --color-neutral
Text --color-text-link --color-text-accent
Text --color-text-on-dark-media --color-on-dark
Icon --color-icon-on-dark-media --color-icon-on-dark
Background --color-wash --color-background-body
Background --color-surface --color-background-surface
Background --color-card --color-background-card
Background --color-popover --color-background-popover
Background --color-muted --color-background-muted
Effects --color-hover-tint --color-tint-hover
Palette --color-{color}-background --color-background-{color}
Palette --color-{color}-border --color-border-{color}
Palette --color-{color}-icon --color-icon-{color}
Palette --color-{color}-text --color-text-{color}
(40 palette tokens across 10 colors — reversed naming pattern, values unchanged)
Size --size-sm --size-element-sm
Size --size-md --size-element-md
Size --size-lg --size-element-lg
Radius --radius-0 --radius-none
Radius --radius-1 --radius-inner
Radius --radius-2 --radius-element
Radius --radius-3 --radius-container
Radius --radius-rounded --radius-full
Shadow --shadow-menu --shadow-low
Shadow --shadow-hover --shadow-med
Shadow --shadow-dialog --shadow-high
Shadow --inset-shadow-border-hover --shadow-inset-hover
Shadow --inset-shadow-border-accent --shadow-inset-selected
Shadow --inset-shadow-border-positive --shadow-inset-success
Shadow --inset-shadow-border-warning --shadow-inset-warning
Shadow --inset-shadow-border-negative --shadow-inset-error
Font Family --font-body --font-family-body
Font Family --font-code --font-family-code
Font Family --font-heading --font-family-heading
Font Size --text-4xs through --text-5xl --font-size-4xs through --font-size-5xl
(12 tokens — values unchanged, e.g. 0.875rem stays 0.875rem)
Type Scale --heading-{1-6}-size/weight/leading --text-heading-{1-6}-size/weight/leading
(18 tokens — values unchanged, var() references updated to new font-size names)

Removed Tokens (12 — ⚠️ = replacement has different value)

Old Token Old Value (Light / Dark) Replaced With Replacement Value Match?
--color-ring-focus #0171E3 / #2694FE --color-accent #0064E0 / #2694FE ⚠️ Light differs
--color-ring-focus-error #E3193B / #F5394F --color-error #E3193B / #F5394F ✅ Same
--color-ring-focus-success #0D8626 / #0D8626 --color-success #0D8626 / #0D8626 ✅ Same
--color-ring-focus-warning #F2C00B / #E9AF08 --color-warning #E9AF08 / #F2C00B ⚠️ L/D swapped
--color-border-strong #647685 / #6F747C --color-border-emphasized #CCD3DB / #494D53 ⚠️ Different
--radius-4 16px --radius-page 16px ✅ Same
--shadow-base 0px 0px 1px ... --shadow-low 0px 1px 1px ... 0px 2px 8px ... ⚠️ Different
--color-icon-on-dark #FFFFFF / #FFFFFF --color-on-accent or --color-on-dark #FFFFFF / #FFFFFF ✅ Same
--color-info #5B08D8 / #6B1EFD (deleted) — 🗑️ Removed
--color-info-muted #7952FF33 / #5B08D83F (deleted) — 🗑️ Removed
--leading-tight/snug/base/normal/relaxed various typeScaleVars['--text-*-leading'] semantic matches ✅ Migrated

--color-icon-on-dark replacement details

Component Usage Replaced With Reason
CheckboxInput Checkmark icon + indeterminate mark --color-on-accent Content on accent background
NavIcon Icon on accent circle --color-on-accent Content on accent background
RadioList Inner dot on accent radio --color-on-accent Content on accent background
Spinner onMedia shade --color-on-dark Content on dark media

--leading-* migration (by @ernestt)

Components now use semantic typeScaleVars leading tokens matched to their fontSize:

  • --leading-base → --text-body-leading or --text-label-leading (exact match)
  • --leading-snug/tight → --text-supporting-leading (matched to supporting font size)
  • --leading-normal → --text-body-leading or --text-large-leading (matched to font size)
  • Edge case: CheckboxInput stays on raw lineHeightVars (uses --font-size-xs with no semantic match)

New Tokens (8)

Token Value (Light / Dark)
--color-on-accent #FFFFFF / #FFFFFF
--color-on-success #FFFFFF / #FFFFFF
--color-on-error #FFFFFF / #FFFFFF
--color-on-warning #0A1317 / #0A1317
--color-on-light #000000 / #000000
--color-icon-accent #0064E0 / #2694FE
--border-width 1px (replaces hardcoded 1px borders in 16 files)
--radius-page 16px (for AppShell page corners — supports concentric radii with nested cards)

Codemods

v0.0.6 codemods are unchanged (they still migrate to v0.0.6 names).

New v0.0.8 codemod (migrate-token-renames.mjs) handles migration from v0.0.6 names to these final names. Covers all 99 renames + 12 removals.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 26, 2026
@rubyycheung

Copy link
Copy Markdown
Contributor Author

@ernestt The --leading-* line height tokens (--leading-tight, --leading-snug, --leading-base, --leading-normal, --leading-relaxed) are marked as "Remove token" in the spreadsheet, but they are still heavily referenced across ~69 files (Badge, Button, Banner, Breadcrumbs, Field, SideNav, Tab, TopNav, etc.).

What should these map to? A few options:

  1. Inline the literal values (e.g. replace lineHeightVars["--leading-base"] with "1.4286")
  2. Keep them as deprecated tokens with a migration path
  3. Map them to something else

Let me know and I can update this PR.

@rubyycheung
rubyycheung marked this pull request as ready for review March 26, 2026 00:47
'--color-accent': 'light-dark(#0064E0, #2694FE)',
'--color-accent-muted': 'light-dark(#0082FB33, #0082FB3F)',
'--color-secondary':
'--color-on-accent': 'light-dark(#000000, #000000)',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should both be white, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha yes

'--color-icon-secondary': 'light-dark(#4E606F, #AAAFB5)',
'--color-icon-disabled': 'light-dark(#A4B0BC, #6F747C)',
'--color-icon-on-dark-media': 'light-dark(#FFFFFF, #FFFFFF)',
'--color-icon-on-dark': 'light-dark(#FFFFFF, #FFFFFF)',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we removed this in favor of --color-on-dark

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like navi missed this

// Status/Sentiment
'--color-success': 'light-dark(#0D8626, #0D8626)',
'--color-success-muted': 'light-dark(#0B991F33, #0B991F3F)',
'--color-on-success': 'light-dark(#000000, #000000)',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be white.

'--color-on-success': 'light-dark(#000000, #000000)',
'--color-error': 'light-dark(#E3193B, #F5394F)',
'--color-error-muted': 'light-dark(#E3193B33, #F5394F3F)',
'--color-on-error': 'light-dark(#000000, #000000)',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be white.

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For codemods, we need to add a new one for v0.0.8 to migrate the v0.0.6 names to this new version. It's probably okay for the v0.0.6 codemods to be update as well, but we will need to migrate anyone on 0.0.7 now.

Comment on lines 60 to 61
'--color-info': 'light-dark(#5B08D8, #6B1EFD)',
'--color-info-muted': 'light-dark(#7952FF33, #5B08D83F)',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we deleted these.

Renames all design tokens based on the token spec spreadsheet.

Token renames (134 files, ~1400 lines changed):
- Color palette: --color-{color}-{type} → --color-{type}-{color}
- Backgrounds: --color-wash/surface/card/popover/muted → --color-background-*
- Text: --color-text-link → --color-text-accent
- Media: --color-text-on-dark-media → --color-on-dark
- Effects: --color-hover-tint → --color-tint-hover
- Status: --color-secondary → --color-neutral
- Size: --size-sm/md/lg → --size-element-sm/md/lg
- Radius: numeric (--radius-0..4) → semantic (--radius-none/inner/element/container/full)
- Shadow: --shadow-base/menu/hover/dialog → --shadow-low/med/high
- Shadow inset: --inset-shadow-border-* → --shadow-inset-*
- Font family: --font-body/code/heading → --font-family-body/code/heading
- Font size: --text-* → --font-size-*
- Type scale: --heading-*-size/weight/leading → --text-heading-*-size/weight/leading

Token removals:
- --color-ring-focus → replaced with --color-accent
- --color-ring-focus-error/success/warning → replaced with --color-error/success/warning
- --color-border-strong → replaced with --color-border-emphasized
- --radius-4 → replaced with --radius-container
- --shadow-base → replaced with --shadow-low

NOT included in this PR (needs discussion):
- --leading-* line height tokens (spreadsheet says remove, but heavily used in ~69 files)
- New tokens: --color-on-accent/success/error/warning, --color-on-light, --color-icon-accent, --border-width
Adds new --border-width token (default: 1px) to borderDefaults/borderVars.
Replaces all hardcoded 1px border widths across 16 component files with
borderVars['--border-width'] for theme-ability.

Affected components: Card, CheckboxInput, DateInput, Field, List,
RadioList, Selector, SideNav, TabList, Table, TimeInput, TopNav,
CodeBlock, CodeEditor.
…arning, on-light, icon-accent)

New tokens per spreadsheet:
- --color-on-accent: #000000 / #000000
- --color-on-success: #000000 / #000000
- --color-on-error: #000000 / #000000
- --color-on-warning: #0A1317 / #0A1317
- --color-on-light: #000000 / #000000
- --color-icon-accent: #0064E0 / #2694FE
- Fix expandRadiusScale: remove duplicate --radius-container (from old --radius-4)
- Fix expandTypeScale: generate --text-heading-N-* instead of --heading-N-*
- Fix defineTheme: reference --text-heading-N-* in prose CSS generation
- Update codemods to target final token names (skip intermediate v0.0.6 names)
- Update all test expectations to match new token names
…ternatives

Per spreadsheet: remove --color-icon-on-dark and use --color-on-* tokens.

Replacements:
- CheckboxInput (checkmark + indeterminate mark) → --color-on-accent
- NavIcon (icon on accent circle) → --color-on-accent
- RadioList (inner dot on accent radio) → --color-on-accent
- Spinner (onMedia shade) → --color-on-dark

Also:
- Restore v0.0.6 codemods to original state (per review feedback)
- Add new v0.0.8 codemod for token renames with tests
@rubyycheung
rubyycheung force-pushed the navi/feat/token-renames branch from f8bf07d to 029af2e Compare March 26, 2026 01:07
…st assertions

- Remove --color-info and --color-info-muted (per Cindy's review)
- Fix duplicate token keys in neutral theme (--color-accent, --color-error,
  --color-success, --color-warning, --color-border-emphasized, --shadow-low)
- Fix expandTypeScale test: --heading-N-leading → --text-heading-N-leading
- Fix generateThemeRules test: var(--text-) → var(--font-size-)
…count

- CodeBlock and CodeEditor had duplicate borderVars in imports
- defineTheme test filter updated: --heading- → --font-size- | --text-
@github-actions

github-actions Bot commented Mar 26, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

Modified Components

AppShell · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 862B N/A
Lines of Code N/A 561 -
Complexity N/A Very High (89) -
Avatar · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 310B N/A
Lines of Code N/A 331 -
Complexity N/A High (29) -
Badge · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 264B N/A
Lines of Code N/A 161 -
Complexity N/A Low (5) -
Banner · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 490B N/A
Lines of Code N/A 294 -
Complexity N/A High (21) -
Breadcrumbs · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 350B N/A
Lines of Code N/A 274 -
Complexity N/A Medium (13) -
Button · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 394B N/A
Lines of Code N/A 377 -
Complexity N/A Very High (39) -
Calendar · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 994B N/A
Lines of Code N/A 1001 -
Complexity N/A Very High (141) -
Card · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 326B N/A
Lines of Code N/A 122 -
Complexity N/A Medium (13) -
CheckboxInput · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 504B N/A
Lines of Code N/A 390 -
Complexity N/A Very High (36) -
Collapsible · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 4.7KB N/A
Lines of Code N/A 245 -
Complexity N/A High (18) -
DateInput · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 848B N/A
Lines of Code N/A 413 -
Complexity N/A Very High (57) -
Dialog · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 656B N/A
Lines of Code N/A 334 -
Complexity N/A Very High (43) -
Divider · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 300B N/A
Lines of Code N/A 143 -
Complexity N/A Medium (9) -
DropdownMenu · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 748B N/A
Lines of Code N/A 506 -
Complexity N/A Very High (67) -
EmptyState · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 260B N/A
Lines of Code N/A 136 -
Complexity N/A Medium (8) -
Field · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 879B N/A
Lines of Code N/A 513 -
Complexity N/A High (26) -
HoverCard · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 342B N/A
Lines of Code N/A 441 -
Complexity N/A Very High (44) -
Kbd · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 246B N/A
Lines of Code N/A 96 -
Complexity N/A Medium (10) -
Link · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 642B N/A
Lines of Code N/A 228 -
Complexity N/A Medium (11) -
List · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 292B N/A
Lines of Code N/A 400 -
Complexity N/A Very High (36) -
MobileNav · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 676B N/A
Lines of Code N/A 323 -
Complexity N/A Very High (32) -
MoreMenu · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 686B N/A
Lines of Code N/A 375 -
Complexity N/A Very High (49) -
NavIcon
Metric Before After Delta
Bundle Size (ESM) N/A 254B N/A
Lines of Code N/A 47 -
Complexity N/A Low (1) -
NavItem
Metric Before After Delta
Bundle Size (ESM) N/A 228B N/A
Lines of Code N/A 57 -
Complexity N/A Low (1) -
NumberInput · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 532B N/A
Lines of Code N/A 357 -
Complexity N/A Very High (52) -
Pagination · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 860B N/A
Lines of Code N/A 393 -
Complexity N/A Very High (50) -
Popover · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 406B N/A
Lines of Code N/A 474 -
Complexity N/A Very High (42) -
PowerSearch · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 1.5KB N/A
Lines of Code N/A 3048 -
Complexity N/A Very High (296) -
ProgressBar · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 276B N/A
Lines of Code N/A 224 -
Complexity N/A Medium (13) -
RadioList · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 536B N/A
Lines of Code N/A 420 -
Complexity N/A High (30) -
Section · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 332B N/A
Lines of Code N/A 179 -
Complexity N/A High (24) -
SegmentedControl · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 340B N/A
Lines of Code N/A 304 -
Complexity N/A High (27) -
Selector · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 1.1KB N/A
Lines of Code N/A 929 -
Complexity N/A Very High (49) -
SideNav · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 1.2KB N/A
Lines of Code N/A 1492 -
Complexity N/A Very High (146) -
Skeleton · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 270B N/A
Lines of Code N/A 106 -
Complexity N/A Low (3) -
Slider · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 490B N/A
Lines of Code N/A 691 -
Complexity N/A Very High (86) -
Spinner · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 268B N/A
Lines of Code N/A 116 -
Complexity N/A Medium (8) -
StatusDot · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 258B N/A
Lines of Code N/A 115 -
Complexity N/A Low (3) -
Switch · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 490B N/A
Lines of Code N/A 356 -
Complexity N/A Very High (37) -
TabList · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 540B N/A
Lines of Code N/A 568 -
Complexity N/A High (26) -
Table · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 940B N/A
Lines of Code N/A 867 -
Complexity N/A Very High (61) -
TextArea · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 558B N/A
Lines of Code N/A 296 -
Complexity N/A Very High (35) -
TextInput · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 560B N/A
Lines of Code N/A 222 -
Complexity N/A High (25) -
TimeInput · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 560B N/A
Lines of Code N/A 385 -
Complexity N/A Very High (54) -
Token · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 314B N/A
Lines of Code N/A 356 -
Complexity N/A Medium (14) -
Tokenizer · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 656B N/A
Lines of Code N/A 474 -
Complexity N/A Very High (65) -
Tooltip · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 366B N/A
Lines of Code N/A 415 -
Complexity N/A Very High (47) -
TopNav · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 1.2KB N/A
Lines of Code N/A 1521 -
Complexity N/A Very High (93) -
TreeList · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 302B N/A
Lines of Code N/A 684 -
Complexity N/A Very High (62) -
Typeahead · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 680B N/A
Lines of Code N/A 889 -
Complexity N/A Very High (121) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@xds/core 11.1KB 17.6KB 2.7KB

Accessibility Audit

Status: 7 accessibility violation(s) found — 2 critical, 3 serious, 2 moderate.

XDSBanner - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/15 stories · Learn more
    • WCAG: 1.4.3 (Level AA)
XDSCalendar - 1 issue(s)
  • 🔴 critical: Ensure elements with an ARIA role that require parent roles are contained by them
    • Rule: aria-required-parent · Affects 12/12 stories · Learn more
    • WCAG: 1.3.1 (Level A)
XDSList - 1 issue(s)
  • 🔴 critical: Ensure an element's role supports its ARIA attributes
    • Rule: aria-allowed-attr · Affects 1/10 stories · Learn more
    • WCAG: 4.1.2 (Level A)
XDSPagination - 1 issue(s)
  • 🟡 moderate: Ensure landmarks are unique
    • Rule: landmark-unique · Affects 1/14 stories · Learn more
XDSSideNav - 1 issue(s)
  • 🟠 serious: Ensure links have discernible text
    • Rule: link-name · Affects 1/8 stories · Learn more
    • WCAG: 2.4.4, 4.1.2 (Level A)
XDSTabList - 1 issue(s)
  • 🟡 moderate: Ensure landmarks are unique
    • Rule: landmark-unique · Affects 1/6 stories · Learn more
XDSToken - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/9 stories · Learn more
    • WCAG: 1.4.3 (Level AA)

Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@rubyycheung
rubyycheung requested a review from cixzhang March 26, 2026 01:40
@ernestt

ernestt commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

@rubyycheung thats weird that its still using leading tokens. This PR should have removed all its usage to a hard coded line height. #682

But the components should be using semantic tokens, not hardcoded, not raw leading tokens.

| --text-code-leading | | | 1.4286 | |
| --text-supporting-size | var(--font-size-sm) | 12px | | |
| --text-supporting-weight | | | | normal |
| --text-supporting-leading | | | 1.6667 | |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing display tokens

Comment thread packages/cli/docs/tokens.md Outdated
Comment on lines +222 to +232
@@ -223,13 +223,13 @@ Override the entire scale with `typography.scale: { base, ratio }` in `defineThe

Intent-based ratios for component use. Not modified by `typography.scale`.

| Token | Value | Usage |
| ----------------- | ------ | ---------------------------- |
| --leading-tight | 1.25 | Display text, headings |
| --leading-snug | 1.375 | Compact body text, headings |
| --leading-base | 1.4286 | Body text with --text-base |
| --leading-normal | 1.5 | Body text, large body |
| --leading-relaxed | 1.625 | Editorial body, reading text |
| Token | Value | Usage |
| ----------------- | ------ | ------------------------------- |
| --leading-tight | 1.25 | Display text, headings |
| --leading-snug | 1.375 | Compact body text, headings |
| --leading-base | 1.4286 | Body text with --font-size-base |
| --leading-normal | 1.5 | Body text, large body |
| --leading-relaxed | 1.625 | Editorial body, reading text |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've removed these.

Comment on lines +455 to +460
h1: {fontSize: 'var(--font-size-2xl)', lineHeight: '1.2'},
h2: {fontSize: 'var(--font-size-xl)', lineHeight: '1.333'},
h3: {fontSize: 'var(--font-size-lg)', lineHeight: '1.25'},
h4: {fontSize: 'var(--font-size-base)', lineHeight: 'var(--leading-base)'},
h5: {fontSize: 'var(--font-size-base)', lineHeight: 'var(--leading-base)'},
h6: {fontSize: 'var(--font-size-xs)', lineHeight: '1.333'},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should use the semantic lineHeight vars per type.


// Text element resets
parts.push(` p {\n font-family: var(--font-heading);\n color: var(--color-text-primary);\n margin: 0;\n font-size: var(--text-base);\n line-height: var(--leading-base);\n }`);
parts.push(` p {\n font-family: var(--font-family-heading);\n color: var(--color-text-primary);\n margin: 0;\n font-size: var(--font-size-base);\n line-height: var(--leading-base);\n }`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--leading-base is removed. These should be updated to use the semantic text variables for body text.

parts.push(` p {\n font-family: var(--font-family-heading);\n color: var(--color-text-primary);\n margin: 0;\n font-size: var(--font-size-base);\n line-height: var(--leading-base);\n }`);

parts.push(` small {\n font-size: var(--text-xsm);\n line-height: 1.333;\n color: var(--color-text-secondary);\n }`);
parts.push(` small {\n font-size: var(--font-size-xs);\n line-height: 1.333;\n color: var(--color-text-secondary);\n }`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The font size and line height should be updated to use the semantic text variables for supporting text.

parts.push(` small {\n font-size: var(--font-size-xs);\n line-height: 1.333;\n color: var(--color-text-secondary);\n }`);

parts.push(` code, pre {\n font-family: var(--font-code);\n font-size: var(--text-base);\n line-height: var(--leading-base);\n }`);
parts.push(` code, pre {\n font-family: var(--font-family-code);\n font-size: var(--font-size-base);\n line-height: var(--leading-base);\n }`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the font size and line height should be updated to use the semantic text variables for body text (while keeping the code font family).

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more comments to clean up docs and other related files.

- Fix stale --color-surface in Section.stories.tsx
- Fix --radius-page value 16→28px in create-theme.md
- Fix duplicate --radius-container→--radius-page in tokens.md, tokens.doc.mjs
- Fix duplicate --shadow-low row in tokens.doc.mjs
- Add --radius-page to radius-evaluator.md, theme.md, theme.doc.mjs
- Add display tokens (display-1/2/3) to tokens.md type scale docs
- Add --border-width token to tokens.md
- Add --color-on-accent/success/error/warning/dark/light to tokens.md
- Add --color-icon-accent to tokens.md
- Mark --leading-* tokens as deprecated with migration table in tokens.md
- Update radius description from 'Numeric' to 'Semantic' in tokens.md/doc
- Fix theme-editor code example to use --color-on-accent (not on-dark)

Co-authored-by: Navi <[email protected]>
@cixzhang

Copy link
Copy Markdown
Contributor

Second pass review + fixes (b61d42d)

Deep comb through all 142 files. Ruby's fixes from earlier look good (theme-editor cleanup, create-theme radius-page). Pushed additional fixes:

Stale token references

  • Section.stories.tsx: --color-surface → --color-background-surface (the only remaining stale usage in component/story code)
  • create-theme.md: --radius-page value was 16px, now 28px
  • theme-editor: code example used --color-on-dark for button on accent bg → --color-on-accent

Duplicate/wrong entries in docs

  • tokens.doc.mjs: duplicate --shadow-low row merged into one
  • tokens.md + tokens.doc.mjs: duplicate --radius-container (12px + 16px) → second row corrected to --radius-page (28px)
  • tokens.md + tokens.doc.mjs: radius description updated from "Numeric scale, Tokens 1–4" to "Semantic scale, inner through page"
  • theme.md + theme.doc.mjs: radius range updated to include --radius-page
  • radius-evaluator.md: added --radius-page to both semantic and numeric tables

Missing documentation

  • tokens.md: added --color-on-accent/success/error/warning/dark/light to semantic colors table
  • tokens.md: added --color-icon-accent to icon colors table
  • tokens.md: added --border-width section
  • tokens.md: added display tokens (display-1/2/3 size/weight/leading)
  • tokens.md: marked --leading-* section as deprecated with migration table

One thing to note

--color-info / --color-info-muted are removed in this PR, but the v0.0.8 codemod doesn't handle migrating them away. If someone on v0.0.6 has --color-info usage, they'd get stranded. Probably fine since it was barely used, but worth a note in the codemod or migration guide.

1984 tests pass, build + lint clean.

--color-info (#5B08D8) is an exact match for --color-icon-purple.
--color-info-muted (#7952FF33) matches --color-background-purple.
This ensures v0.0.6 consumers with --color-info usage have a clean
migration path to v0.0.8.

Co-authored-by: Navi <[email protected]>
@cixzhang

Copy link
Copy Markdown
Contributor

You should remove the leading and add a codemod to migrate them per the table Ernest suggested

There's a visual bug in XDSField -- we have gap between the label and description but now with the leading update we should remove that gap. Keep the gap between the (label+description) and the input though.

cixzhang and others added 2 commits March 26, 2026 22:24
…eVars

Remove --leading-* tokens entirely from tokens.stylex.ts (lineHeightDefaults,
lineHeightVars, lineHeightRaw, LineHeightVarName). All internal usage was
already migrated to semantic typeScaleVars leading tokens.

The v0.0.8 codemod now handles the full migration for external consumers:
- String renames: '--leading-base' → '--text-body-leading' (etc.)
- Identifier renames: lineHeightVars → typeScaleVars, lineHeightDefaults →
  typeScaleDefaults (imports + all references)

This is the only case where a Vars object name changes — all other token
renames (color, size, radius, shadow, font, type scale) keep the same
Vars object, so string replacement alone is sufficient.

Co-authored-by: Navi <[email protected]>
With the leading token migration, the line-height on descriptions is
now correct and the 4px gap between label and description is visually
redundant. Wrap label+description in a labelGroup div so the container
gap (--spacing-1) only applies between (label+description) and the
input control, not between label and description.

Co-authored-by: Navi <[email protected]>
@rubyycheung
rubyycheung merged commit d057635 into main Mar 26, 2026
10 of 11 checks passed
cixzhang added a commit that referenced this pull request Mar 26, 2026
…meEditor

lineHeightDefaults was removed in #894 (token rename). Line height
tokens are now part of typeScaleDefaults (--text-*-leading).

Co-authored-by: Navi <[email protected]>
cixzhang added a commit that referenced this pull request Mar 26, 2026
* feat(storybook): add Internal Web Apps Analytics dashboard story

Two-tab dashboard comparing Intern (www) vs Nest platform adoption
and design system metrics. Built entirely with XDS components.

Overview tab:
- 4 stat cards (tools, apps, WAU) with % change indicators
- DAU line chart (Intern vs Nest, 14d)
- New tool/app creation line chart

Design Systems tab:
- 3 stat grids: Components, Insertions, Tools/Apps Using
- Quick link buttons
- XDS on Intern details section with:
  - Component count timeline chart
  - Oncalls by org horizontal bar chart
  - Searchable component adoption table with pagination

Components used: XDSCard, XDSTabList, XDSTable, XDSPagination,
XDSTextInput, XDSButton, XDSLink, XDSDivider, XDSHeading, XDSText
Charts: inline SVG (no external dependencies)

Co-authored-by: Navi <[email protected]>

* feat(storybook): update analytics dashboard with XDSTopNav, tabs, adoption table, two-column charts

* feat(storybook): add info/refresh/link icons to chart cards, tighten spacing

* feat(storybook): search button, chart title updates, dropdown filter

* feat(storybook): dynamic library dropdown, color tokens, dialog improvements, table icons, layout refinements

* feat(storybook): add top bar and toolbar to Theme Editor

* fix: update ThemeEditor imports for current API (elevationDefaults→shadowDefaults, icon path)

* fix: replace removed lineHeightDefaults with typeScaleDefaults in ThemeEditor

lineHeightDefaults was removed in #894 (token rename). Line height
tokens are now part of typeScaleDefaults (--text-*-leading).

Co-authored-by: Navi <[email protected]>

---------

Co-authored-by: Navi <[email protected]>
Co-authored-by: cixzhang <[email protected]>
Co-authored-by: Navi <[email protected]>
@cixzhang
cixzhang deleted the navi/feat/token-renames branch April 9, 2026 14:32
cixzhang pushed a commit that referenced this pull request Apr 26, 2026
* refactor: rename design tokens to match new naming convention

Renames all design tokens based on the token spec spreadsheet.

Token renames (134 files, ~1400 lines changed):
- Color palette: --color-{color}-{type} → --color-{type}-{color}
- Backgrounds: --color-wash/surface/card/popover/muted → --color-background-*
- Text: --color-text-link → --color-text-accent
- Media: --color-text-on-dark-media → --color-on-dark
- Effects: --color-hover-tint → --color-tint-hover
- Status: --color-secondary → --color-neutral
- Size: --size-sm/md/lg → --size-element-sm/md/lg
- Radius: numeric (--radius-0..4) → semantic (--radius-none/inner/element/container/full)
- Shadow: --shadow-base/menu/hover/dialog → --shadow-low/med/high
- Shadow inset: --inset-shadow-border-* → --shadow-inset-*
- Font family: --font-body/code/heading → --font-family-body/code/heading
- Font size: --text-* → --font-size-*
- Type scale: --heading-*-size/weight/leading → --text-heading-*-size/weight/leading

Token removals:
- --color-ring-focus → replaced with --color-accent
- --color-ring-focus-error/success/warning → replaced with --color-error/success/warning
- --color-border-strong → replaced with --color-border-emphasized
- --radius-4 → replaced with --radius-container
- --shadow-base → replaced with --shadow-low

NOT included in this PR (needs discussion):
- --leading-* line height tokens (spreadsheet says remove, but heavily used in ~69 files)
- New tokens: --color-on-accent/success/error/warning, --color-on-light, --color-icon-accent, --border-width

* feat: add --border-width token and replace hardcoded 1px borders

Adds new --border-width token (default: 1px) to borderDefaults/borderVars.
Replaces all hardcoded 1px border widths across 16 component files with
borderVars['--border-width'] for theme-ability.

Affected components: Card, CheckboxInput, DateInput, Field, List,
RadioList, Selector, SideNav, TabList, Table, TimeInput, TopNav,
CodeBlock, CodeEditor.

* feat: add new tokens from spec (on-accent, on-success, on-error, on-warning, on-light, icon-accent)

New tokens per spreadsheet:
- --color-on-accent: #000000 / #000000
- --color-on-success: #000000 / #000000
- --color-on-error: #000000 / #000000
- --color-on-warning: #0A1317 / #0A1317
- --color-on-light: #000000 / #000000
- --color-icon-accent: #0064E0 / #2694FE

* fix: update tests, codemods, and generation logic for new token names

- Fix expandRadiusScale: remove duplicate --radius-container (from old --radius-4)
- Fix expandTypeScale: generate --text-heading-N-* instead of --heading-N-*
- Fix defineTheme: reference --text-heading-N-* in prose CSS generation
- Update codemods to target final token names (skip intermediate v0.0.6 names)
- Update all test expectations to match new token names

* fix: update --color-on-accent/success/error values to #FFFFFF

* refactor: remove --color-icon-on-dark token, replace with semantic alternatives

Per spreadsheet: remove --color-icon-on-dark and use --color-on-* tokens.

Replacements:
- CheckboxInput (checkmark + indeterminate mark) → --color-on-accent
- NavIcon (icon on accent circle) → --color-on-accent
- RadioList (inner dot on accent radio) → --color-on-accent
- Spinner (onMedia shade) → --color-on-dark

Also:
- Restore v0.0.6 codemods to original state (per review feedback)
- Add new v0.0.8 codemod for token renames with tests

* fix: remove --color-info tokens, fix neutral theme duplicates, fix test assertions

- Remove --color-info and --color-info-muted (per Cindy's review)
- Fix duplicate token keys in neutral theme (--color-accent, --color-error,
  --color-success, --color-warning, --color-border-emphasized, --shadow-low)
- Fix expandTypeScale test: --heading-N-leading → --text-heading-N-leading
- Fix generateThemeRules test: var(--text-) → var(--font-size-)

* fix: remove duplicate borderVars imports, fix defineTheme test token count

- CodeBlock and CodeEditor had duplicate borderVars in imports
- defineTheme test filter updated: --heading- → --font-size- | --text-

* refactor: migrate lineHeightVars to semantic typeScaleVars leading tokens

Replace raw lineHeightVars['--leading-*'] with the corresponding
typeScaleVars['--text-{semantic}-leading'] based on each component's
paired fontSize token:

- --text-body-size → --text-body-leading (12 usages)
- --text-label-size → --text-label-leading (14 usages)
- --text-supporting-size → --text-supporting-leading (26 usages)
- --text-large-size → --text-large-leading (3 usages)

For Breadcrumbs, moved lineHeight from shared root styles into
size-specific variants (defaultSize/supportingSize) since each
variant maps to a different semantic leading token.

Only remaining lineHeightVars usage: CheckboxInput description
(--font-size-xs / 10px) which has no semantic type scale token.

37 files changed, 64 raw token references replaced with semantic ones.

* refactor: migrate CheckboxInput description to supporting text tokens

Replace raw textSizeVars['--font-size-xs'] (10px) and
lineHeightVars['--leading-relaxed'] with semantic
typeScaleVars['--text-supporting-size'] (12px) and
typeScaleVars['--text-supporting-leading'].

This completes the lineHeightVars migration — zero raw leading
token usages remain in components.

* feat: add --radius-page token (16px) for AppShell page corners

Adds --radius-page (16px) to support concentric corner radii when cards
(12px radius) are nested inside pages with 16px padding:
  page radius (16px) = card radius (12px) + page padding (4px gap)

- Added to radiusDefaults and expandRadiusScale (base * 4 * multiplier)
- AppShell elevated backdrop now uses --radius-page instead of --radius-container
- Updated radius scale tests

---------

Co-authored-by: ernestt <[email protected]>
cixzhang added a commit that referenced this pull request Apr 26, 2026
* feat(storybook): add Internal Web Apps Analytics dashboard story

Two-tab dashboard comparing Intern (www) vs Nest platform adoption
and design system metrics. Built entirely with XDS components.

Overview tab:
- 4 stat cards (tools, apps, WAU) with % change indicators
- DAU line chart (Intern vs Nest, 14d)
- New tool/app creation line chart

Design Systems tab:
- 3 stat grids: Components, Insertions, Tools/Apps Using
- Quick link buttons
- XDS on Intern details section with:
  - Component count timeline chart
  - Oncalls by org horizontal bar chart
  - Searchable component adoption table with pagination

Components used: XDSCard, XDSTabList, XDSTable, XDSPagination,
XDSTextInput, XDSButton, XDSLink, XDSDivider, XDSHeading, XDSText
Charts: inline SVG (no external dependencies)

Co-authored-by: Navi <[email protected]>

* feat(storybook): update analytics dashboard with XDSTopNav, tabs, adoption table, two-column charts

* feat(storybook): add info/refresh/link icons to chart cards, tighten spacing

* feat(storybook): search button, chart title updates, dropdown filter

* feat(storybook): dynamic library dropdown, color tokens, dialog improvements, table icons, layout refinements

* feat(storybook): add top bar and toolbar to Theme Editor

* fix: update ThemeEditor imports for current API (elevationDefaults→shadowDefaults, icon path)

* fix: replace removed lineHeightDefaults with typeScaleDefaults in ThemeEditor

lineHeightDefaults was removed in #894 (token rename). Line height
tokens are now part of typeScaleDefaults (--text-*-leading).

Co-authored-by: Navi <[email protected]>

---------

Co-authored-by: Navi <[email protected]>
Co-authored-by: cixzhang <[email protected]>
Co-authored-by: Navi <[email protected]>
cixzhang pushed a commit that referenced this pull request Jun 21, 2026
* refactor: rename design tokens to match new naming convention

Renames all design tokens based on the token spec spreadsheet.

Token renames (134 files, ~1400 lines changed):
- Color palette: --color-{color}-{type} → --color-{type}-{color}
- Backgrounds: --color-wash/surface/card/popover/muted → --color-background-*
- Text: --color-text-link → --color-text-accent
- Media: --color-text-on-dark-media → --color-on-dark
- Effects: --color-hover-tint → --color-tint-hover
- Status: --color-secondary → --color-neutral
- Size: --size-sm/md/lg → --size-element-sm/md/lg
- Radius: numeric (--radius-0..4) → semantic (--radius-none/inner/element/container/full)
- Shadow: --shadow-base/menu/hover/dialog → --shadow-low/med/high
- Shadow inset: --inset-shadow-border-* → --shadow-inset-*
- Font family: --font-body/code/heading → --font-family-body/code/heading
- Font size: --text-* → --font-size-*
- Type scale: --heading-*-size/weight/leading → --text-heading-*-size/weight/leading

Token removals:
- --color-ring-focus → replaced with --color-accent
- --color-ring-focus-error/success/warning → replaced with --color-error/success/warning
- --color-border-strong → replaced with --color-border-emphasized
- --radius-4 → replaced with --radius-container
- --shadow-base → replaced with --shadow-low

NOT included in this PR (needs discussion):
- --leading-* line height tokens (spreadsheet says remove, but heavily used in ~69 files)
- New tokens: --color-on-accent/success/error/warning, --color-on-light, --color-icon-accent, --border-width

* feat: add --border-width token and replace hardcoded 1px borders

Adds new --border-width token (default: 1px) to borderDefaults/borderVars.
Replaces all hardcoded 1px border widths across 16 component files with
borderVars['--border-width'] for theme-ability.

Affected components: Card, CheckboxInput, DateInput, Field, List,
RadioList, Selector, SideNav, TabList, Table, TimeInput, TopNav,
CodeBlock, CodeEditor.

* feat: add new tokens from spec (on-accent, on-success, on-error, on-warning, on-light, icon-accent)

New tokens per spreadsheet:
- --color-on-accent: #000000 / #000000
- --color-on-success: #000000 / #000000
- --color-on-error: #000000 / #000000
- --color-on-warning: #0A1317 / #0A1317
- --color-on-light: #000000 / #000000
- --color-icon-accent: #0064E0 / #2694FE

* fix: update tests, codemods, and generation logic for new token names

- Fix expandRadiusScale: remove duplicate --radius-container (from old --radius-4)
- Fix expandTypeScale: generate --text-heading-N-* instead of --heading-N-*
- Fix defineTheme: reference --text-heading-N-* in prose CSS generation
- Update codemods to target final token names (skip intermediate v0.0.6 names)
- Update all test expectations to match new token names

* fix: update --color-on-accent/success/error values to #FFFFFF

* refactor: remove --color-icon-on-dark token, replace with semantic alternatives

Per spreadsheet: remove --color-icon-on-dark and use --color-on-* tokens.

Replacements:
- CheckboxInput (checkmark + indeterminate mark) → --color-on-accent
- NavIcon (icon on accent circle) → --color-on-accent
- RadioList (inner dot on accent radio) → --color-on-accent
- Spinner (onMedia shade) → --color-on-dark

Also:
- Restore v0.0.6 codemods to original state (per review feedback)
- Add new v0.0.8 codemod for token renames with tests

* fix: remove --color-info tokens, fix neutral theme duplicates, fix test assertions

- Remove --color-info and --color-info-muted (per Cindy's review)
- Fix duplicate token keys in neutral theme (--color-accent, --color-error,
  --color-success, --color-warning, --color-border-emphasized, --shadow-low)
- Fix expandTypeScale test: --heading-N-leading → --text-heading-N-leading
- Fix generateThemeRules test: var(--text-) → var(--font-size-)

* fix: remove duplicate borderVars imports, fix defineTheme test token count

- CodeBlock and CodeEditor had duplicate borderVars in imports
- defineTheme test filter updated: --heading- → --font-size- | --text-

* refactor: migrate lineHeightVars to semantic typeScaleVars leading tokens

Replace raw lineHeightVars['--leading-*'] with the corresponding
typeScaleVars['--text-{semantic}-leading'] based on each component's
paired fontSize token:

- --text-body-size → --text-body-leading (12 usages)
- --text-label-size → --text-label-leading (14 usages)
- --text-supporting-size → --text-supporting-leading (26 usages)
- --text-large-size → --text-large-leading (3 usages)

For Breadcrumbs, moved lineHeight from shared root styles into
size-specific variants (defaultSize/supportingSize) since each
variant maps to a different semantic leading token.

Only remaining lineHeightVars usage: CheckboxInput description
(--font-size-xs / 10px) which has no semantic type scale token.

37 files changed, 64 raw token references replaced with semantic ones.

* refactor: migrate CheckboxInput description to supporting text tokens

Replace raw textSizeVars['--font-size-xs'] (10px) and
lineHeightVars['--leading-relaxed'] with semantic
typeScaleVars['--text-supporting-size'] (12px) and
typeScaleVars['--text-supporting-leading'].

This completes the lineHeightVars migration — zero raw leading
token usages remain in components.

* feat: add --radius-page token (16px) for AppShell page corners

Adds --radius-page (16px) to support concentric corner radii when cards
(12px radius) are nested inside pages with 16px padding:
  page radius (16px) = card radius (12px) + page padding (4px gap)

- Added to radiusDefaults and expandRadiusScale (base * 4 * multiplier)
- AppShell elevated backdrop now uses --radius-page instead of --radius-container
- Updated radius scale tests

---------

Co-authored-by: ernestt <[email protected]>
cixzhang added a commit that referenced this pull request Jun 21, 2026
* feat(storybook): add Internal Web Apps Analytics dashboard story

Two-tab dashboard comparing Intern (www) vs Nest platform adoption
and design system metrics. Built entirely with XDS components.

Overview tab:
- 4 stat cards (tools, apps, WAU) with % change indicators
- DAU line chart (Intern vs Nest, 14d)
- New tool/app creation line chart

Design Systems tab:
- 3 stat grids: Components, Insertions, Tools/Apps Using
- Quick link buttons
- XDS on Intern details section with:
  - Component count timeline chart
  - Oncalls by org horizontal bar chart
  - Searchable component adoption table with pagination

Components used: XDSCard, XDSTabList, XDSTable, XDSPagination,
XDSTextInput, XDSButton, XDSLink, XDSDivider, XDSHeading, XDSText
Charts: inline SVG (no external dependencies)

Co-authored-by: Navi <[email protected]>

* feat(storybook): update analytics dashboard with XDSTopNav, tabs, adoption table, two-column charts

* feat(storybook): add info/refresh/link icons to chart cards, tighten spacing

* feat(storybook): search button, chart title updates, dropdown filter

* feat(storybook): dynamic library dropdown, color tokens, dialog improvements, table icons, layout refinements

* feat(storybook): add top bar and toolbar to Theme Editor

* fix: update ThemeEditor imports for current API (elevationDefaults→shadowDefaults, icon path)

* fix: replace removed lineHeightDefaults with typeScaleDefaults in ThemeEditor

lineHeightDefaults was removed in #894 (token rename). Line height
tokens are now part of typeScaleDefaults (--text-*-leading).

Co-authored-by: Navi <[email protected]>

---------

Co-authored-by: Navi <[email protected]>
Co-authored-by: cixzhang <[email protected]>
Co-authored-by: Navi <[email protected]>
cixzhang pushed a commit that referenced this pull request Jun 21, 2026
* refactor: rename design tokens to match new naming convention

Renames all design tokens based on the token spec spreadsheet.

Token renames (134 files, ~1400 lines changed):
- Color palette: --color-{color}-{type} → --color-{type}-{color}
- Backgrounds: --color-wash/surface/card/popover/muted → --color-background-*
- Text: --color-text-link → --color-text-accent
- Media: --color-text-on-dark-media → --color-on-dark
- Effects: --color-hover-tint → --color-tint-hover
- Status: --color-secondary → --color-neutral
- Size: --size-sm/md/lg → --size-element-sm/md/lg
- Radius: numeric (--radius-0..4) → semantic (--radius-none/inner/element/container/full)
- Shadow: --shadow-base/menu/hover/dialog → --shadow-low/med/high
- Shadow inset: --inset-shadow-border-* → --shadow-inset-*
- Font family: --font-body/code/heading → --font-family-body/code/heading
- Font size: --text-* → --font-size-*
- Type scale: --heading-*-size/weight/leading → --text-heading-*-size/weight/leading

Token removals:
- --color-ring-focus → replaced with --color-accent
- --color-ring-focus-error/success/warning → replaced with --color-error/success/warning
- --color-border-strong → replaced with --color-border-emphasized
- --radius-4 → replaced with --radius-container
- --shadow-base → replaced with --shadow-low

NOT included in this PR (needs discussion):
- --leading-* line height tokens (spreadsheet says remove, but heavily used in ~69 files)
- New tokens: --color-on-accent/success/error/warning, --color-on-light, --color-icon-accent, --border-width

* feat: add --border-width token and replace hardcoded 1px borders

Adds new --border-width token (default: 1px) to borderDefaults/borderVars.
Replaces all hardcoded 1px border widths across 16 component files with
borderVars['--border-width'] for theme-ability.

Affected components: Card, CheckboxInput, DateInput, Field, List,
RadioList, Selector, SideNav, TabList, Table, TimeInput, TopNav,
CodeBlock, CodeEditor.

* feat: add new tokens from spec (on-accent, on-success, on-error, on-warning, on-light, icon-accent)

New tokens per spreadsheet:
- --color-on-accent: #000000 / #000000
- --color-on-success: #000000 / #000000
- --color-on-error: #000000 / #000000
- --color-on-warning: #0A1317 / #0A1317
- --color-on-light: #000000 / #000000
- --color-icon-accent: #0064E0 / #2694FE

* fix: update tests, codemods, and generation logic for new token names

- Fix expandRadiusScale: remove duplicate --radius-container (from old --radius-4)
- Fix expandTypeScale: generate --text-heading-N-* instead of --heading-N-*
- Fix defineTheme: reference --text-heading-N-* in prose CSS generation
- Update codemods to target final token names (skip intermediate v0.0.6 names)
- Update all test expectations to match new token names

* fix: update --color-on-accent/success/error values to #FFFFFF

* refactor: remove --color-icon-on-dark token, replace with semantic alternatives

Per spreadsheet: remove --color-icon-on-dark and use --color-on-* tokens.

Replacements:
- CheckboxInput (checkmark + indeterminate mark) → --color-on-accent
- NavIcon (icon on accent circle) → --color-on-accent
- RadioList (inner dot on accent radio) → --color-on-accent
- Spinner (onMedia shade) → --color-on-dark

Also:
- Restore v0.0.6 codemods to original state (per review feedback)
- Add new v0.0.8 codemod for token renames with tests

* fix: remove --color-info tokens, fix neutral theme duplicates, fix test assertions

- Remove --color-info and --color-info-muted (per Cindy's review)
- Fix duplicate token keys in neutral theme (--color-accent, --color-error,
  --color-success, --color-warning, --color-border-emphasized, --shadow-low)
- Fix expandTypeScale test: --heading-N-leading → --text-heading-N-leading
- Fix generateThemeRules test: var(--text-) → var(--font-size-)

* fix: remove duplicate borderVars imports, fix defineTheme test token count

- CodeBlock and CodeEditor had duplicate borderVars in imports
- defineTheme test filter updated: --heading- → --font-size- | --text-

* refactor: migrate lineHeightVars to semantic typeScaleVars leading tokens

Replace raw lineHeightVars['--leading-*'] with the corresponding
typeScaleVars['--text-{semantic}-leading'] based on each component's
paired fontSize token:

- --text-body-size → --text-body-leading (12 usages)
- --text-label-size → --text-label-leading (14 usages)
- --text-supporting-size → --text-supporting-leading (26 usages)
- --text-large-size → --text-large-leading (3 usages)

For Breadcrumbs, moved lineHeight from shared root styles into
size-specific variants (defaultSize/supportingSize) since each
variant maps to a different semantic leading token.

Only remaining lineHeightVars usage: CheckboxInput description
(--font-size-xs / 10px) which has no semantic type scale token.

37 files changed, 64 raw token references replaced with semantic ones.

* refactor: migrate CheckboxInput description to supporting text tokens

Replace raw textSizeVars['--font-size-xs'] (10px) and
lineHeightVars['--leading-relaxed'] with semantic
typeScaleVars['--text-supporting-size'] (12px) and
typeScaleVars['--text-supporting-leading'].

This completes the lineHeightVars migration — zero raw leading
token usages remain in components.

* feat: add --radius-page token (16px) for AppShell page corners

Adds --radius-page (16px) to support concentric corner radii when cards
(12px radius) are nested inside pages with 16px padding:
  page radius (16px) = card radius (12px) + page padding (4px gap)

- Added to radiusDefaults and expandRadiusScale (base * 4 * multiplier)
- AppShell elevated backdrop now uses --radius-page instead of --radius-container
- Updated radius scale tests

---------

Co-authored-by: ernestt <[email protected]>
cixzhang added a commit that referenced this pull request Jun 21, 2026
* feat(storybook): add Internal Web Apps Analytics dashboard story

Two-tab dashboard comparing Intern (www) vs Nest platform adoption
and design system metrics. Built entirely with XDS components.

Overview tab:
- 4 stat cards (tools, apps, WAU) with % change indicators
- DAU line chart (Intern vs Nest, 14d)
- New tool/app creation line chart

Design Systems tab:
- 3 stat grids: Components, Insertions, Tools/Apps Using
- Quick link buttons
- XDS on Intern details section with:
  - Component count timeline chart
  - Oncalls by org horizontal bar chart
  - Searchable component adoption table with pagination

Components used: XDSCard, XDSTabList, XDSTable, XDSPagination,
XDSTextInput, XDSButton, XDSLink, XDSDivider, XDSHeading, XDSText
Charts: inline SVG (no external dependencies)


* feat(storybook): update analytics dashboard with XDSTopNav, tabs, adoption table, two-column charts

* feat(storybook): add info/refresh/link icons to chart cards, tighten spacing

* feat(storybook): search button, chart title updates, dropdown filter

* feat(storybook): dynamic library dropdown, color tokens, dialog improvements, table icons, layout refinements

* feat(storybook): add top bar and toolbar to Theme Editor

* fix: update ThemeEditor imports for current API (elevationDefaults→shadowDefaults, icon path)

* fix: replace removed lineHeightDefaults with typeScaleDefaults in ThemeEditor

lineHeightDefaults was removed in #894 (token rename). Line height
tokens are now part of typeScaleDefaults (--text-*-leading).


---------

Co-authored-by: cixzhang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants