Button: Align colors with WPDS tokens - #82506
Draft
ciampo wants to merge 4 commits into
Draft
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
🤖 PR meta 🤖📦 Bundle sizeSize Change: +837 B (+0.01%) Total Size: 8.01 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
|
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.
What?
Follow-up to #82294. Uses the Button color mapping from #79994 as precedent, without its sizing and spacing migration.
Aligns the legacy
@wordpress/componentsButton's color declarations with WPDS semantic tokens across variants and states.Why?
After #82294, the legacy primary Button combined HSL-darkened backgrounds with a foreground calculated for a different semantic background. With primary
#608010and background#4f386e, contrast was about 4.59:1 at rest, 3.36:1 on hover, and 2.45:1 while pressed.The same legacy color variables also kept secondary, tertiary, link, destructive, pressed, disabled, and busy states from following the token pairs used by the WordPress Design System.
How?
.is-primaryblock and updates its declarations in place.The compiled CSS retains design-token fallbacks for use outside
ThemeProvider. The internal--wp-components-color-accent*variables no longer control Button colors.Testing Instructions
npm run build.npm run storybook:e2e:devin one terminal.npm run test:e2e:storybook -- --grep "WPDS colors"in another terminal.#608010and background#4f386e.Testing Instructions for Keyboard
Screenshots or screencast
Not included. The regression is asserted from computed browser styles in the Storybook Playwright test.
Use of AI Tools
Codex assisted with implementation, test authoring, verification, and this draft text. Please review the changes before merge.