Skip to content

apps/ui: migrate to @wordpress/theme 0.11 token names - #3231

Merged
youknowriad merged 1 commit into
trunkfrom
migrate-apps-ui-to-theme-0.11-tokens
Apr 24, 2026
Merged

apps/ui: migrate to @wordpress/theme 0.11 token names#3231
youknowriad merged 1 commit into
trunkfrom
migrate-apps-ui-to-theme-0.11-tokens

Conversation

@youknowriad

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

Claude Code performed the migration. For each stale token, I cross-referenced the new token list in node_modules/@wordpress/theme/build-module/prebuilt/js/design-tokens.mjs and the fallback values in design-token-fallbacks.mjs, matching visual intent rather than doing blind string replacement. Ambiguous tokens (--wpds-color-border, --wpds-color-text, --wpds-color-surface-hover, etc.) were mapped by comparing the old fallback values in-context to the new fallback values and picking the token that best matched the original intent.

Proposed Changes

The 0.11 release of @wordpress/theme renamed a large number of design tokens. Its postcss plugin (postcss-ds-token-fallbacks) now throws Unknown design token on any unrecognized name, so npm start hard-fails until every reference is migrated.

This PR migrates every var(--wpds-*) reference in apps/ui/src/**/*.css to the new names. It is a pure CSS migration — no JS/TS files or configuration are touched.

Mechanical renames (apply uniformly to every size/variant suffix):

Old prefix New prefix
--wpds-font-size-* --wpds-typography-font-size-*
--wpds-font-family-* --wpds-typography-font-family-*
--wpds-font-line-height-* --wpds-typography-line-height-*
--wpds-font-weight-* --wpds-typography-font-weight-*
--wpds-dimension-radius-* --wpds-border-radius-*
--wpds-shadow-elevation-md --wpds-elevation-md
--wpds-color-fg-content-critical --wpds-color-fg-content-error
--wpds-color-stroke-neutral-weak --wpds-color-stroke-surface-neutral-weak
--wpds-color-bg-surface-strong --wpds-color-bg-surface-neutral-strong

Ambiguous renames (resolved by matching the old fallback value and usage intent):

Old token (old fallback) New token (new fallback) Reasoning
--wpds-color-border (#ccc/#ddd) --wpds-color-stroke-surface-neutral (#dbdbdb) Static decorative border
--wpds-color-border-hover (#888/#bbb) --wpds-color-stroke-interactive-neutral (#8d8d8d) Border on interactive hover
--wpds-color-surface (#fff) --wpds-color-bg-surface-neutral-strong (#ffffff) Static card/panel background
--wpds-color-surface-hover (#f7f7f7) --wpds-color-bg-interactive-neutral-weak-active (#ededed) Interactive hover background
--wpds-color-bg-surface-neutral-hover --wpds-color-bg-interactive-neutral-weak-active (#ededed) Same — row/menu hover
--wpds-color-text (#1e1e1e) --wpds-color-fg-content-neutral (#1e1e1e) Body text (exact match)
--wpds-color-text-secondary (#555/#666) --wpds-color-fg-content-neutral-weak (#707070) Secondary/muted text
--wpds-color-text-link (#0075ff) --wpds-color-fg-interactive-brand (admin theme color) Link color
--wpds-color-fg-content-accent (#2563eb) --wpds-color-fg-interactive-brand (admin theme color) Accent/brand color

25 files changed in apps/ui/src.

Testing Instructions

  • npm start launches without any [postcss] Unknown design token: ... errors.
  • Visually inspect surfaces that exercised the ambiguous tokens: file dropzone hover state, blueprint selector cards, site list rows, publish picker dropdown, thinking indicator / composer accent color, disconnect-site dialog critical color, onboarding layout cards, learn-more links, sync activity indicator badge (--wpds-color-bg-surface-strong--wpds-color-bg-surface-neutral-strong).
  • Hover states on file-dropzone, blueprint selector, onboarding cards, and publish-picker rows — should be subtly different from the resting background.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

Verified locally:

  • npm run build -w @studio/ui produced dist/assets/index-Cho0-sdX.css (223KB) without postcss errors — this runs the same dsTokenFallbacksPostcss plugin the dev server uses.
  • npm run typecheck passes.
  • npx eslint --fix on the changed files is a no-op (CSS is not linted).

🤖 Generated with Claude Code

The 0.11 release renamed a large number of design tokens and the postcss
plugin now throws on any unknown token. Update every CSS reference in
apps/ui/src to the new names, preserving visual intent by matching fallback
values in design-token-fallbacks.mjs where the mapping was ambiguous.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@youknowriad youknowriad self-assigned this Apr 24, 2026
@youknowriad
youknowriad merged commit ec521bd into trunk Apr 24, 2026
7 of 10 checks passed
@youknowriad
youknowriad deleted the migrate-apps-ui-to-theme-0.11-tokens branch April 24, 2026 13:06
@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 05a9f17 vs trunk

app-size

Metric trunk 05a9f17 Diff Change
App Size (Mac) 1440.82 MB 1440.82 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk 05a9f17 Diff Change
load 1814 ms 1808 ms 6 ms ⚪ 0.0%

site-startup

Metric trunk 05a9f17 Diff Change
siteCreation 8115 ms 8122 ms +7 ms ⚪ 0.0%
siteStartup 4940 ms 4955 ms +15 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants