Repository navigation
Components: Use theme colors in Panel and ToolsPanel - #87427
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: +240 B (0%) Total Size: 8.72 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. Navigates the list via UP/DOWN arrow keys from action buttons in
|
Replace the components theme variables with WPDS surface tokens, and give the Panel icon and the disabled ToolsPanel reset label the token states that match their interactive roles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Disabled default control items never render the reset label. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| color: $gray-700; | ||
| } | ||
|
|
||
| .reset-label { |
There was a problem hiding this comment.
It looks like this rule never matched a real combination:
- Item with a value: shows the "Reset" label, and the item is never disabled.
- Item without a value: disabled, with only a check icon and no "Reset" label.
* Components: Use theme colors in Panel and ToolsPanel * Docs: Link changelogs to WordPress#87427 * Components: Use WPDS tokens directly in Panel and ToolsPanel Replace the components theme variables with WPDS surface tokens, and give the Panel icon and the disabled ToolsPanel reset label the token states that match their interactive roles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Components: Remove unused ToolsPanel reset label rule Disabled default control items never render the reset label. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Extracted from #82294. This change can land on trunk independently.
What?
Make Panel and ToolsPanel follow the active theme. Panel surfaces, borders, toggle labels, icons, chevrons, and ToolsPanel menu labels now use WPDS color tokens directly.
Why?
Fixed white surfaces and gray controls stand out in dark and custom themes. A panel toggle, its icon, and its chevron should also respond together to hover and keyboard focus.
How?
Use the WPDS tokens directly, not the components theme variables, and pair them as the token guide recommends. Some colors change slightly as a result.
background-surface-neutral-strongwithforeground-content-neutral, asCardin@wordpress/uidoes.Buttonpairing:foreground-interactive-neutralwith its-activeand-disabledstates, over abackground-interactive-neutral-weak-activehover fill. The chevron inherits the toggle color.foreground-interactive-neutral-weakwith the matching-activeand-disabledstates.foreground-interactive-neutraland its-disabledstate. An unused rule for the reset label of disabled items is removed, because those items never render that label.Testing Instructions
In Storybook, open Panel → With Icon and switch between light and dark themes. Hover the section title: the label, the icon, and the chevron darken together. Open Panel → Disabled section and check that the toggle looks disabled. Open ToolsPanel → Default and open the options menu: the default controls look disabled and Scale looks enabled.
Testing Instructions for Keyboard
Tab to the Panel toggle and press Space to expand and collapse it. In ToolsPanel, open the menu with Enter, use the arrow keys to move through the controls, and close it with Escape.
Screenshots
Panel → With Icon is shown with the section toggle hovered. ToolsPanel → Default is shown with its options menu open.
Light theme (default)
Dark theme
Use of AI Tools
OpenAI Codex extracted the changes from #82294. Claude Code switched the styles to WPDS tokens, captured the screenshots, and updated this description.