Repository navigation
feat(tokens): rename design tokens per naming audit - #698
Merged
Merged
Conversation
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsAppShell · View in Storybook
Avatar · View in Storybook
Badge · View in Storybook
Banner · View in Storybook
Button · View in Storybook
Calendar · View in Storybook
Card · View in Storybook
CheckboxInput · View in Storybook
Collapsible · View in Storybook
DateInput · View in Storybook
Dialog · View in Storybook
Divider · View in Storybook
DropdownMenu · View in Storybook
Field · View in Storybook
HoverCard · View in Storybook
Icon · View in Storybook
Kbd · View in Storybook
Layout · View in Storybook
Link · View in Storybook
List · View in Storybook
MobileNav · View in Storybook
MoreMenu · View in Storybook
NavIcon
NavItem
NumberInput · View in Storybook
Pagination · View in Storybook
Popover · View in Storybook
ProgressBar · View in Storybook
RadioList · View in Storybook
Section · View in Storybook
Selector · View in Storybook
SideNav · View in Storybook
Skeleton · View in Storybook
Slider · View in Storybook
Spinner · View in Storybook
StatusDot · View in Storybook
Switch · View in Storybook
TabList · View in Storybook
Table · View in Storybook
Text · View in Storybook
TextArea · View in Storybook
TextInput · View in Storybook
TimeInput · View in Storybook
Token · View in Storybook
Tokenizer · View in Storybook
Tooltip · View in Storybook
TopNav · View in Storybook
TreeList · View in Storybook
Typeahead · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: 13 accessibility violation(s) found — 1 critical, 10 serious, 2 moderate. XDSAvatar - 1 issue(s)
XDSBanner - 1 issue(s)
XDSCalendar - 1 issue(s)
XDSCheckboxInput - 1 issue(s)
XDSIcon - 1 issue(s)
XDSLayout - 1 issue(s)
XDSList - 1 issue(s)
XDSPagination - 1 issue(s)
XDSSideNav - 1 issue(s)
XDSTabList - 1 issue(s)
Selection - 1 issue(s)
XDSText - 1 issue(s)
XDSToken - 1 issue(s)
Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
cixzhang
commented
Mar 18, 2026
Contributor
|
Context on naming positive and negative #683 |
Comprehensive token rename based on the token naming review spreadsheet. Removes 3 redundant tokens, renames 32 tokens for consistency. Semantic clarity: - --color-accent → --color-primary - --color-accent-deemphasized → --color-primary-muted - --color-deemphasized → --color-muted - --color-positive → --color-success - --color-negative → --color-error - --color-educational → --color-info - *-deemphasized → *-muted (across all status tokens) Noun-first grammar (thing → modifier): - --color-hover-overlay → --color-overlay-hover - --color-pressed-overlay → --color-overlay-pressed - --color-disabled-overlay → --color-overlay-disabled - --color-focus-outline-* → --color-ring-focus-* Border/divider consolidation: - --color-divider → --color-border - --color-divider-high-contrast → --color-border-strong - --color-divider-emphasized → --color-border-emphasized Effects: - --color-glimmer → --color-skeleton - --color-glimmer-high-contrast → --color-skeleton-strong - --color-shadow-elevation → --color-shadow Media: - --color-text-on-media → --color-text-on-dark-media - --color-icon-on-media → --color-icon-on-dark-media - --color-accent-text → use --color-text-link - --color-text-placeholder → use --color-text-secondary - --color-icon-tertiary → use --color-icon-secondary - --radius-inner → --radius-0 - --radius-content → --radius-1 - --radius-element → --radius-2 - --radius-container → --radius-3 - --radius-page → --radius-4 Fixes radius codemod to use old→new semantic names. Updates all components, themes, docs, stories, and tests. Co-authored-by: Navi <[email protected]>
Adds a jscodeshift codemod that migrates all color/effect token names from the v0.0.5 naming audit. Handles string literals, template literals, and property access patterns. 28 token renames covering: - Semantic clarity (accent→primary, positive→success, negative→error, educational→info) - Noun-first grammar (hover-overlay→overlay-hover, focus-outline→ring-focus) - Border consolidation (divider→border) - Effects (glimmer→skeleton, shadow-elevation→shadow) - Media (on-media→on-dark-media) - Removals (accent-text→text-link, text-placeholder→text-secondary, icon-tertiary→icon-secondary) 22 tests covering all renames, edge cases, and partial match safety. Co-authored-by: Navi <[email protected]>
Keep --color-accent instead of --color-primary to avoid ambiguity with --color-text-primary and --color-icon-primary. Vibe test showed that 'primary' as both the brand color AND the highest-emphasis foreground tier causes confusion — LLMs reaching for --color-primary when they mean --color-text-primary (body text). With --color-accent, there's zero collision. All other renames (success/error/info/border/skeleton/etc.) stay. - --color-accent (kept, not renamed) - --color-accent-deemphasized → --color-accent-muted (muted suffix only) - Codemod updated: removed accent→primary mapping - 22 codemod tests updated and passing Co-authored-by: Navi <[email protected]>
New semantic token for secondary interactive elements: light-dark(rgba(5, 54, 89, 0.1), rgba(223, 226, 229, 0.2)) Uses the same value as the existing secondary button override color. Applied to Button (secondary variant), Badge (neutral variant), and Token (default color) — replacing --color-muted which is now reserved for general deemphasized backgrounds. This lets themes override the secondary interactive color independently from the muted background color. Co-authored-by: Navi <[email protected]>
cixzhang
force-pushed
the
navi/feat/token-renames
branch
from
March 19, 2026 01:31
6f52d5a to
1758cd5
Compare
Adds --color-secondary token: light-dark(rgba(5, 54, 89, 0.1), rgba(223, 226, 229, 0.2)) Used for Button (secondary), Badge (neutral), Token (default) — distinct from --color-muted which is for general deemphasized bgs. Removes --color-skeleton-strong — Skeleton now derives its high-contrast variant using color-mix() with --color-text-primary, adapting to any theme automatically. Co-authored-by: Navi <[email protected]>
Aligns token names closer to Tailwind CSS conventions: - --insetshadow-border-* → --inset-shadow-border-* - --easing-standard → --ease-standard - easingVars/easingDefaults/EasingVarName → easeVars/easeDefaults/EaseVarName Updates shadow codemod to output --inset-shadow-border-* names. All 68 codemod tests passing. Co-authored-by: Navi <[email protected]>
Adds the Tailwind-alignment renames to migrate-token-names codemod: - --insetshadow-border-* → --inset-shadow-border-* - --easing-standard → --ease-standard 2 new test cases (24 total). All 70 codemod tests passing. Co-authored-by: Navi <[email protected]>
rubyycheung
added a commit
that referenced
this pull request
Mar 19, 2026
Tokens were renamed on main (PR #698). Updated all references: - accent-deemphasized → accent-muted - hover-overlay → overlay-hover, pressed-overlay → overlay-pressed - focus-outline → ring-focus (and error/success/warning variants) - deemphasized → muted - text-on-media → text-on-dark-media, icon-on-media → icon-on-dark-media - divider → border, divider-high-contrast → border-strong, divider-emphasized → border-emphasized - positive → success, negative → error (and muted variants) - educational → info (and muted variant) - glimmer → skeleton, shadow-elevation → shadow Removed tokens no longer in core: - accent-text, text-placeholder, icon-tertiary, glimmer-high-contrast
cixzhang
added a commit
that referenced
this pull request
Mar 19, 2026
PR #698 renamed --color-divider to --color-border across the codebase. Updated the popoverSurface borderColor to use the new token name. Co-authored-by: Navi <[email protected]>
cixzhang
added a commit
that referenced
this pull request
Mar 20, 2026
* feat(SideNav): popover for collapsed items with children When the SideNav is collapsed to icon-only mode, items with sub-items now show a popover on click: - Appears to the end (right in LTR) of the icon-only trigger - Contains children rendered in expanded form (not collapsed) via XDSSideNavCollapseProvider wrapping with isCollapsed: false - Closes on click outside, escape, or clicking a child item - Shows the parent label as a header in the popover - Uses XDS design tokens for surface, border, elevation, and radius Items without children in collapsed mode render as icon-only link/button with tooltip (existing behavior, cleaned up). Changes: - XDSSideNavCollapseContext.ts → .tsx with XDSSideNavCollapseProvider - XDSSideNavItem: collapsed render path with useXDSPopover - Removed dead isCollapsed references in expanded render path - 8 new tests for collapsed mode behavior Co-authored-by: Navi <[email protected]> * feat: hover to open collapsed subnav popover Popover now opens on hover (150ms delay) in addition to click, matching TopNavMenu behavior. Hovering the popover content keeps it open; leaving both trigger and panel closes after 200ms. Co-authored-by: Navi <[email protected]> * refactor: remove XDSSideNavCollapseProvider, use context directly React 19 supports <Context value={...}> without .Provider. Remove the unnecessary Provider wrapper — use XDSSideNavCollapseContext directly in SideNavItem popover and test helpers. CollapseContext file stays as .ts (no JSX needed). Co-authored-by: Navi <[email protected]> * fix: move hooks before early return to prevent hooks violation All useRef/useCallback hooks must run before the early return for items without icons in collapsed mode. React requires the same number of hooks every render. Co-authored-by: Navi <[email protected]> * fix: use --color-popover for collapsed subnav popover surface Co-authored-by: Navi <[email protected]> * refactor: extract collapsedItemStyles, move xdsClassName to item elements - Extract shared collapsed item styles (navItemStyles.item + itemCollapsed + selected + disabled) into a single collapsedItemStyles variable - Move xdsClassName('side-nav-item') from wrapper div to the actual item elements (button/link/trigger) where the styles are applied - Wrapper divs now only get styles.root Co-authored-by: Navi <[email protected]> * fix: add xdsClassName to expanded items, 4px popover offset - Move xdsClassName('side-nav-item') to expanded link/button elements (was only on wrapper div) - Add marginInlineStart: spacing-1 (4px) to popover surface for gap between trigger and popover Co-authored-by: Navi <[email protected]> * fix: update --color-divider to --color-border after #698 merge PR #698 renamed --color-divider to --color-border across the codebase. Updated the popoverSurface borderColor to use the new token name. Co-authored-by: Navi <[email protected]> --------- Co-authored-by: Navi <[email protected]>
rubyycheung
added a commit
that referenced
this pull request
Mar 21, 2026
Tokens were renamed on main (PR #698). Updated all references: - accent-deemphasized → accent-muted - hover-overlay → overlay-hover, pressed-overlay → overlay-pressed - focus-outline → ring-focus (and error/success/warning variants) - deemphasized → muted - text-on-media → text-on-dark-media, icon-on-media → icon-on-dark-media - divider → border, divider-high-contrast → border-strong, divider-emphasized → border-emphasized - positive → success, negative → error (and muted variants) - educational → info (and muted variant) - glimmer → skeleton, shadow-elevation → shadow Removed tokens no longer in core: - accent-text, text-placeholder, icon-tertiary, glimmer-high-contrast
rubyycheung
added a commit
that referenced
this pull request
Mar 22, 2026
Tokens were renamed on main (PR #698). Updated all references: - accent-deemphasized → accent-muted - hover-overlay → overlay-hover, pressed-overlay → overlay-pressed - focus-outline → ring-focus (and error/success/warning variants) - deemphasized → muted - text-on-media → text-on-dark-media, icon-on-media → icon-on-dark-media - divider → border, divider-high-contrast → border-strong, divider-emphasized → border-emphasized - positive → success, negative → error (and muted variants) - educational → info (and muted variant) - glimmer → skeleton, shadow-elevation → shadow Removed tokens no longer in core: - accent-text, text-placeholder, icon-tertiary, glimmer-high-contrast
cixzhang
added a commit
that referenced
this pull request
Apr 26, 2026
cixzhang
added a commit
that referenced
this pull request
Apr 26, 2026
* feat(SideNav): popover for collapsed items with children When the SideNav is collapsed to icon-only mode, items with sub-items now show a popover on click: - Appears to the end (right in LTR) of the icon-only trigger - Contains children rendered in expanded form (not collapsed) via XDSSideNavCollapseProvider wrapping with isCollapsed: false - Closes on click outside, escape, or clicking a child item - Shows the parent label as a header in the popover - Uses XDS design tokens for surface, border, elevation, and radius Items without children in collapsed mode render as icon-only link/button with tooltip (existing behavior, cleaned up). Changes: - XDSSideNavCollapseContext.ts → .tsx with XDSSideNavCollapseProvider - XDSSideNavItem: collapsed render path with useXDSPopover - Removed dead isCollapsed references in expanded render path - 8 new tests for collapsed mode behavior Co-authored-by: Navi <[email protected]> * feat: hover to open collapsed subnav popover Popover now opens on hover (150ms delay) in addition to click, matching TopNavMenu behavior. Hovering the popover content keeps it open; leaving both trigger and panel closes after 200ms. Co-authored-by: Navi <[email protected]> * refactor: remove XDSSideNavCollapseProvider, use context directly React 19 supports <Context value={...}> without .Provider. Remove the unnecessary Provider wrapper — use XDSSideNavCollapseContext directly in SideNavItem popover and test helpers. CollapseContext file stays as .ts (no JSX needed). Co-authored-by: Navi <[email protected]> * fix: move hooks before early return to prevent hooks violation All useRef/useCallback hooks must run before the early return for items without icons in collapsed mode. React requires the same number of hooks every render. Co-authored-by: Navi <[email protected]> * fix: use --color-popover for collapsed subnav popover surface Co-authored-by: Navi <[email protected]> * refactor: extract collapsedItemStyles, move xdsClassName to item elements - Extract shared collapsed item styles (navItemStyles.item + itemCollapsed + selected + disabled) into a single collapsedItemStyles variable - Move xdsClassName('side-nav-item') from wrapper div to the actual item elements (button/link/trigger) where the styles are applied - Wrapper divs now only get styles.root Co-authored-by: Navi <[email protected]> * fix: add xdsClassName to expanded items, 4px popover offset - Move xdsClassName('side-nav-item') to expanded link/button elements (was only on wrapper div) - Add marginInlineStart: spacing-1 (4px) to popover surface for gap between trigger and popover Co-authored-by: Navi <[email protected]> * fix: update --color-divider to --color-border after #698 merge PR #698 renamed --color-divider to --color-border across the codebase. Updated the popoverSurface borderColor to use the new token name. Co-authored-by: Navi <[email protected]> --------- Co-authored-by: Navi <[email protected]>
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
* feat(SideNav): popover for collapsed items with children When the SideNav is collapsed to icon-only mode, items with sub-items now show a popover on click: - Appears to the end (right in LTR) of the icon-only trigger - Contains children rendered in expanded form (not collapsed) via XDSSideNavCollapseProvider wrapping with isCollapsed: false - Closes on click outside, escape, or clicking a child item - Shows the parent label as a header in the popover - Uses XDS design tokens for surface, border, elevation, and radius Items without children in collapsed mode render as icon-only link/button with tooltip (existing behavior, cleaned up). Changes: - XDSSideNavCollapseContext.ts → .tsx with XDSSideNavCollapseProvider - XDSSideNavItem: collapsed render path with useXDSPopover - Removed dead isCollapsed references in expanded render path - 8 new tests for collapsed mode behavior Co-authored-by: Navi <[email protected]> * feat: hover to open collapsed subnav popover Popover now opens on hover (150ms delay) in addition to click, matching TopNavMenu behavior. Hovering the popover content keeps it open; leaving both trigger and panel closes after 200ms. Co-authored-by: Navi <[email protected]> * refactor: remove XDSSideNavCollapseProvider, use context directly React 19 supports <Context value={...}> without .Provider. Remove the unnecessary Provider wrapper — use XDSSideNavCollapseContext directly in SideNavItem popover and test helpers. CollapseContext file stays as .ts (no JSX needed). Co-authored-by: Navi <[email protected]> * fix: move hooks before early return to prevent hooks violation All useRef/useCallback hooks must run before the early return for items without icons in collapsed mode. React requires the same number of hooks every render. Co-authored-by: Navi <[email protected]> * fix: use --color-popover for collapsed subnav popover surface Co-authored-by: Navi <[email protected]> * refactor: extract collapsedItemStyles, move xdsClassName to item elements - Extract shared collapsed item styles (navItemStyles.item + itemCollapsed + selected + disabled) into a single collapsedItemStyles variable - Move xdsClassName('side-nav-item') from wrapper div to the actual item elements (button/link/trigger) where the styles are applied - Wrapper divs now only get styles.root Co-authored-by: Navi <[email protected]> * fix: add xdsClassName to expanded items, 4px popover offset - Move xdsClassName('side-nav-item') to expanded link/button elements (was only on wrapper div) - Add marginInlineStart: spacing-1 (4px) to popover surface for gap between trigger and popover Co-authored-by: Navi <[email protected]> * fix: update --color-divider to --color-border after #698 merge PR #698 renamed --color-divider to --color-border across the codebase. Updated the popoverSurface borderColor to use the new token name. Co-authored-by: Navi <[email protected]> --------- Co-authored-by: Navi <[email protected]>
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
cixzhang
added a commit
that referenced
this pull request
Jun 21, 2026
* feat(SideNav): popover for collapsed items with children
When the SideNav is collapsed to icon-only mode, items with sub-items
now show a popover on click:
- Appears to the end (right in LTR) of the icon-only trigger
- Contains children rendered in expanded form (not collapsed) via
XDSSideNavCollapseProvider wrapping with isCollapsed: false
- Closes on click outside, escape, or clicking a child item
- Shows the parent label as a header in the popover
- Uses XDS design tokens for surface, border, elevation, and radius
Items without children in collapsed mode render as icon-only
link/button with tooltip (existing behavior, cleaned up).
Changes:
- XDSSideNavCollapseContext.ts → .tsx with XDSSideNavCollapseProvider
- XDSSideNavItem: collapsed render path with useXDSPopover
- Removed dead isCollapsed references in expanded render path
- 8 new tests for collapsed mode behavior
* feat: hover to open collapsed subnav popover
Popover now opens on hover (150ms delay) in addition to click,
matching TopNavMenu behavior. Hovering the popover content keeps
it open; leaving both trigger and panel closes after 200ms.
* refactor: remove XDSSideNavCollapseProvider, use context directly
React 19 supports <Context value={...}> without .Provider. Remove
the unnecessary Provider wrapper — use XDSSideNavCollapseContext
directly in SideNavItem popover and test helpers.
CollapseContext file stays as .ts (no JSX needed).
* fix: move hooks before early return to prevent hooks violation
All useRef/useCallback hooks must run before the early return for
items without icons in collapsed mode. React requires the same
number of hooks every render.
* fix: use --color-popover for collapsed subnav popover surface
* refactor: extract collapsedItemStyles, move xdsClassName to item elements
- Extract shared collapsed item styles (navItemStyles.item + itemCollapsed +
selected + disabled) into a single collapsedItemStyles variable
- Move xdsClassName('side-nav-item') from wrapper div to the actual item
elements (button/link/trigger) where the styles are applied
- Wrapper divs now only get styles.root
* fix: add xdsClassName to expanded items, 4px popover offset
- Move xdsClassName('side-nav-item') to expanded link/button elements
(was only on wrapper div)
- Add marginInlineStart: spacing-1 (4px) to popover surface for gap
between trigger and popover
* fix: update --color-divider to --color-border after #698 merge
PR #698 renamed --color-divider to --color-border across the codebase.
Updated the popoverSurface borderColor to use the new token name.
---------
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.
Token Naming Audit — Full Rename + Codemod
Implements the finalized token names from the naming review spreadsheet, and adds a codemod so consumers can auto-migrate.
Summary
Color Renames
Semantic clarity:
--color-accent→--color-primary--color-positive→--color-success--color-negative→--color-error--color-educational→--color-info*-deemphasized→*-muted(all status tokens)Noun-first grammar (thing → modifier):
--color-hover-overlay→--color-overlay-hover--color-focus-outline-*→--color-ring-focus-*Border/divider consolidation:
--color-divider→--color-border--color-divider-high-contrast→--color-border-strongEffects:
--color-glimmer→--color-skeleton--color-shadow-elevation→--color-shadowToken Removals
--color-accent-text--color-text-link--color-text-placeholder--color-text-secondary--color-icon-tertiary--color-icon-secondaryCodemod
Consumers can auto-migrate with:
npx @xds/cli upgrade --from 0.0.4 --to 0.0.5 --apply # or run just this codemod: npx @xds/cli upgrade --codemod migrate-token-names --applyThe
migrate-token-namescodemod handles:colorVars["--color-accent"])var()references ("var(--color-divider)")`var(--color-accent)`)defineThemetoken objects22 test cases covering all renames, edge cases, and partial match safety.