Repository navigation
Button: Use WPDS colors for disabled states - #86681
Conversation
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +28 B (0%) Total Size: 8.64 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. Should duplicate the widgets in should undo without broken temporary state in
|
|
Some relevant history in #70674. This solves the same original issue, and perhaps from the approach recommended from the later discussion linked from 70674 that reverted the original variant. |
|
Good cross-reference! Since this PR uses the new WPDS foreground/background pair, they also address the original contrast issue. For example, with the default light-theme colors, the darker label gives about 2.70:1 contrast, compared with 1.36:1 in the reverted change. |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the focused migration of disabled Button colors to WordPress Design System tokens.
No open issues 🎉
What changed in this PR
This PR migrates ordinary disabled Button colors to WordPress Design System tokens as a focused step toward broader Button color alignment.
Changes:
- Uses theme-aware disabled foreground colors and a neutral disabled primary fill.
- Preserves existing selectors, enabled colors, busy stripes, and pressed-specific overrides.
- Documents the change in the components changelog.
| File | Description |
|---|---|
packages/components/src/button/style.scss |
Replaces disabled color values with WPDS tokens. |
packages/components/CHANGELOG.md |
Adds an enhancement entry for disabled Button colors. |
Review effort: Balanced
c4aff03 to
fb5d688
Compare
|
PS those neutral / brand WPDS mismatches shouldn't really happen, I'm trying to make agents instructions clearer in #86724 |
* Button: Use WPDS colors for disabled states * Button: Link disabled color changelog to its PR * Button: Align disabled color roles and clarify changelog --- Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org>
First value-only slice of #85073, following the discussion about smaller changes.
What?
Use WPDS tokens for ordinary disabled Button colors, including native and focusable disabled controls.
Why?
Disabled primary buttons currently retain a saturated brand or destructive fill, and other disabled labels use a fixed gray in dark themes.
How?
Replace color values in the existing declarations. The compiled selectors, specificity, layout, enabled colors, and busy stripes stay unchanged. Pressed-specific overrides remain for the later Button/Toolbar/header migration.
Testing Instructions
npm run storybook:e2e:devand open Components → Button → Variant States.Testing Instructions for Keyboard
Tab to a focusable disabled button. Its focus ring should remain visible, and Enter or Space should not activate it.
Screenshots or screencast
Refreshed after rebasing onto trunk
f12625757ec. After:fb5d6885e56. Both sides use the same Button source with the production components stylesheet compiled from the indicated revision. Variant States uses a 1060 × 760 viewport with reduced motion. The dark detail shows the native-disabled row from the matrix below.Use of AI Tools
Implemented with Codex, including independent local agent review and browser verification.
Complete color-state comparisons
Each matrix renders all five variants with every combination of pressed, destructive, busy, and enabled/native-disabled/focusable-disabled props. The local fixture uses Button and its production package stylesheet. Hover, focus, and active matrices use browser-forced CSS states to expose the full cascade. A real Space activation was also checked. Disabled controls forced active are CSS inspection cases, not claims that they can be activated. The one-off fixture and checks are not part of this PR.
Before: trunk
f12625757ec. After:fb5d6885e56. Matching 1180 × 1450 viewport and reduced motion.Real editor: header and block toolbar overrides
The isolated WordPress editor runs this checkout at
fb5d6885e56. Both captures use the same paragraph, active Bold control, and open Block Inserter at 1440 × 1000 with reduced motion. Before loads the production components stylesheet compiled from trunkf12625757ec; after loads the current checkout's production stylesheet. The surrounding editor code is the same in both captures.