Repository navigation
Toolbar, Widgets: Use semantic surface and focus colors - #84573
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: +110 B (0%) Total Size: 8.65 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. Submenu interactions on Safari (@WebKit) in
|
e9351f0 to
9ac2e29
Compare
|
@jameskoster early ping to get some initial design feedback, these are changes extracted from #82294 |
|
Does this mean a disabled pressed button would look the same as a disabled _un_pressed button? 🤔 |
|
They already do in If this is something we don't like, we should agree on a spec, work out any missing WPDS tokens need, and apply it to |
That's not what I see. Currently a disabled pressed button has a background, but a disabled not-pressed button doesn't. |
|
My bad, I could have been more detailed. What I was meant to say is that in
|
|
Ah, yes, I think that's okay. My main concern is that the pressed/unpressed states should be visually different for the minimal, neutral button. |
9ac2e29 to
143561e
Compare
143561e to
3d58ed2
Compare
|
Retargeted to only Toolbar borders/focus rings and Widgets/Customizer header colors, since #86684 now takes care of pressed states |
|
Changes feel now simple and self-contained enough to be mergeable without a formal approval, especially as it will save some previous review time that can be dedicated to more complex PRs. Always happy to follow-up if any feedback comes through. |

Related to #86684. Targets trunk directly; the pressed-control migration remains in #86684.
What?
Use WPDS semantic colors for Toolbar borders and focus rings, the Widgets header background and toolbar dividers, and the Customizer Widgets header background and bottom border.
Why?
Fixed surface colors and legacy focus colors do not follow dark and custom themes.
How?
Replace the remaining color declarations with semantic tokens and use the shared
outset-ring__focus()mixin for Toolbar focus. The outline keeps the inset toolbar rectangle and standard offset used by the design system.Testing Instructions
Testing Instructions for Keyboard
Use Tab to enter the Toolbar and Left/Right Arrow to move between controls. Check that the focus ring remains visible in light, dark, and custom themes. In the post editor, use Alt+F10 to enter the block toolbar and Space to toggle Bold. In Widgets and the Customizer, use Tab to reach the header controls.
Screenshots or screencast
Compared the previous PR head
9eefe479f44with this update in Chromium. These matching compositions use production Toolbar, ToolbarButton, ToolbarGroup, and ThemeProvider components. Bold is pressed and has keyboard focus. Screenshots show the toolbar detail at 2× resolution, including its clipping container edges.Editor focus and clipping verification
Verified the production build in Chromium with Twenty Twenty-One. Focused Bold remained visible before and after toggling its pressed state. Pressed-button focus passed in floating and fixed toolbars, including at 390px viewport width. First and last controls passed clipping checks. Grouped, ungrouped, unstyled, and vertical component compositions also passed in light, dark, custom, and forced-colors modes. Forced colors used browser emulation.
Running Widgets editor and Customizer
Both use the same isolated Twenty Twenty-One site at 1280 × 900. Before and after load the corresponding compiled styles. Widgets shows a selected heading with Top toolbar enabled; the Customizer shows Widgets → Footer.
Use of AI Tools
Codex helped rescope the changes, verify them, update this description, and capture the browser comparisons.