Repository navigation
Theme: Swap resting and active fills for strong neutral controls - #87429
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: +155 B (0%) Total Size: 8.73 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
|
mirka
left a comment
There was a problem hiding this comment.
In the default light theme, solid brand buttons darken on hover, and with this change solid neutral buttons lighten. I'm assuming this is an intentional choice, and I have an instinct about why that choice was made, but it may be worth writing that reasoning down explicitly in the PR, for the record.
6a2dda6 to
a8a942e
Compare
…dPress#87429) * Theme: Swap resting and active fills for strong neutral controls * Docs: Link changelogs to WordPress#87429 * Theme: Name the swapped tokens in the changelog --- Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org>
Extracted from #82294. This proposal uses the two neutral fills already available on trunk.
What?
Swap the resting and active background colors for strong neutral controls. In the default light theme, a solid neutral Button rests at
#1e1e1eand hovers at#2e2e2e. In the dark theme, it rests at#f0f0f0and hovers at#dadada.Why?
This is a design decision about which state gets the stronger fill. #82294 softens the color that strong neutral controls use at rest. In a review of #82294, Jay noted that neutral actions lose strength and suggested flipping the fills: darker at rest, lighter on hover or when active. This PR makes that swap first, so a resting solid control keeps the highest contrast after #82294 lands.
As a result, the two solid variants move in opposite directions on hover in the default light theme. A brand Button darkens, and a neutral Button lightens. This difference is intentional: it keeps the neutral resting fill at full strength.
The swap also changes consumers that use the active color for a persistent pressed or selected state.
How?
Swap the existing background aliases and regenerate their published values. Both states use the same foreground. Across the nine bundled admin schemes, the lowest text contrast measured for either state was 11.87:1.
Testing Instructions
Testing Instructions for Keyboard
Tab to the solid neutral Button, press and hold Space, then release it. Check that the focus ring and label remain visible. Move through Calendar with the arrow keys and select a day.
Screenshots
Solid neutral Button in the default light theme.
Use of AI Tools
OpenAI Codex extracted the token change from #82294, regenerated its outputs, checked the contrast, and drafted this description. Claude Code rebased the branch, applied the review feedback, and updated this description.
🤖 Generated with Claude Code