Skip to content

Refactor token architecture for clarity and consistency#112

Merged
jaymantri merged 1 commit intomainfrom
refactor/token-architecture
Feb 27, 2026
Merged

Refactor token architecture for clarity and consistency#112
jaymantri merged 1 commit intomainfrom
refactor/token-architecture

Conversation

@jaymantri
Copy link
Contributor

@jaymantri jaymantri commented Feb 27, 2026

Summary

  • Renames 12 tokens for consistency (e.g., invertedinverse, tertiaryprimary, elevatedpanel)
  • Removes 8 unused tokens and their Figma variables
  • Adds 4 new tokens: --border-focus, --stroke-primary, --surface-panel, --text-link
  • Introduces state token group for focus-ring colors (--state-focus, --state-focus-critical)
  • Recalibrates dark mode surface hierarchy for better panel/background separation
  • Updates 44 component files and 2 token source files

Key Renames

Old New Notes
--surface-elevated --surface-panel Floating UI (dialogs, tooltips, popovers, action bars, tab indicators, switch thumb). Name describes what it is, not what it does.
--border-tertiary --border-primary Was the default UI border; "tertiary" was a misnomer
--surface-strong --surface-neutral Describes role, not intensity
All *-inverted tokens *-inverse Naming standardization across border, surface, text, icon groups

See commit message for the full rename map.

Breaking Changes

Silent value change: --border-primary changed from solid (#1A1A1A) to alpha (rgba(38, 38, 35, 0.10)). This will not cause build errors but may cause visual regressions in consumers using it directly for focus outlines or chart strokes. See commit message for full migration guide.

Removed tokens will resolve to nothing — consumers must find-and-replace using the rename map in the commit message.

Consumer Migration

No sequencing required. Bump Origin, find-and-replace old token names, audit --border-primary and --input-focus usage, test dark mode. Full migration guide is in the commit message.

Test Plan

  • ESLint + Stylelint: 0 errors
  • Production build: compiles cleanly
  • Unit tests: 365/365 passing
  • Stale token scan: 0 references to any deprecated token name in Origin or Grid
  • Visual spot-check in Storybook (light + dark mode)

@vercel
Copy link

vercel bot commented Feb 27, 2026

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

Project Deployment Actions Updated (UTC)
origin-storybook Ready Ready Preview, Comment Feb 27, 2026 6:06am

Request Review

BREAKING CHANGE: 20 tokens removed, 12 added, values changed on --border-primary.

## Token Rename Map

Old Token                        → New Token
--border-tertiary                → --border-primary
--border-inverted                → --border-inverse
--surface-inverted               → --surface-inverse
--surface-inverted-hover         → --surface-inverse-hover
--surface-strong                 → --surface-neutral
--surface-elevated               → --surface-panel
--surface-sunken                 → --surface-secondary
--text-surface                   → --text-inverse
--icon-surface                   → --icon-inverse
--icon-inverted                  → --icon-inverse
--input-focus (color)            → --state-focus
--input-focus-critical (color)   → --state-focus-critical

Note: --input-focus/--input-focus-critical in _effects.scss (full
box-shadow values) are unchanged. Only the color tokens moved to state-*.

## New Tokens

--border-focus    Solid border for focus outlines (split from old --border-primary)
--stroke-primary  Solid stroke for charts/data visualization only
--surface-panel   Background for floating UI: dialogs, tooltips, popovers, action bars
--text-link       Link text color

## Removed Tokens (no replacement)

--border-hover, --text-muted, --surface-active, --surface-selected,
--surface-inverted-backdrop, --icon-info-inverted, --icon-success-inverted,
--icon-warning-inverted, --icon-critical-inverted

## Silent Value Change: --border-primary

--border-primary still exists but changed value from solid to alpha:
- Light: #1A1A1A → rgba(38, 38, 35, 0.10)
- Dark: #F8F8F7 → rgba(244, 244, 245, 0.10)

This will NOT surface as a build error. Consumers using --border-primary
directly should audit:
- Focus outlines → switch to --border-focus
- Chart strokes → switch to --stroke-primary
- Default UI borders (dividers, card edges) → no action, alpha is correct

## Dark Mode Surface Recalibration

--surface-panel: #111111 → #212121 (lifts panels above --surface-primary)
--surface-secondary: #282828 → #111111 (recedes behind --surface-primary)

## Consumer Migration

No sequencing required. Bump Origin, find-and-replace old token names,
audit --border-primary and --input-focus usage, test dark mode.

Made-with: Cursor
@jaymantri jaymantri merged commit eabf79c into main Feb 27, 2026
6 checks passed
@jaymantri jaymantri deleted the refactor/token-architecture branch February 27, 2026 07:27
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.

2 participants