Repository navigation
Conversation
🤖 PR meta 🤖🏷️ LabelsThis pull request needs exactly one label indicating its type, and has 0.
Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you. 📦 Bundle sizeSize Change: -323 B (0%) Total Size: 8.63 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
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. Actions are reachable via RIGHT/LEFT arrow keys in
|
Contributor
Author
|
Closing in favour of #85073 |
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.
Related: #82506 and #85073 migrate Button colors directly to WPDS tokens. This is a smaller bridge fix that retains legacy accent overrides. #86310 changes admin color seeds; #86189 addresses contrast lost during color rounding.
What?
Fix legacy primary
Buttontext contrast underThemeProviderat rest, on hover, and while active.Why?
With primary
#916745and background#1e1e1e, the styled Button uses black text against legacy fills with contrast of 4.23:1, 3.48:1, and 2.80:1. The bridge derives those fills from the original seed, while its semantic foreground is calculated for adjusted fills.How?
Use the generated resting and active fills for the provider's legacy admin color variables and their RGB companions. Keep the existing Components aliases and consumer override path.
This changes the provider-scoped legacy accent palette for all consumers of those variables. Hover and active now share the semantic active fill, which can be lighter than the resting fill in a dark theme.
Testing Instructions
#916745and background#1e1e1e.#fcfcfc.--wp-components-color-accent,--wp-components-color-accent-darker-10,--wp-components-color-accent-darker-20, and--wp-components-color-accent-inverted. Confirm the Button uses the overrides in each state.Testing Instructions for Keyboard
Move the pointer away, Tab to the primary Button, and hold Space. Confirm the active text/background pair reaches 4.5:1 in both themes. Release Space and confirm activation still works.
Regression coverage and contrast results
The regression tests load the real Button stylesheet and ThemeProvider. The dark-theme case reproduces all three reported failures before the fix. The tests also cover the light theme, held-Space activation, and consumer accent overrides. All 104 affected tests pass in Chromium, along with the production build, scoped type checks, and JavaScript lint.
The bridge's generated pairs give these ratios for primary
#916745:#1e1e1e#fcfcfcScreenshots or screencast
Isolated styled Button at rest with primary
#916745and background#1e1e1e. Matching 240 × 88 captures compare trunkfb727e5d367with this change.Use of AI Tools
Codex investigated the cause, implemented the fix and tests, ran verification, captured the comparison, and drafted this description. A separate Codex agent reviewed the change.