Repository navigation
ToolsPanel: Keep the "Reset" label visible on the highlighted menu item - #86045
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 |
2cf3bf9 to
15ba2af
Compare
| // Match the foreground of the highlighted item's brand fill. | ||
| &:is(:focus, [aria-selected="true"]):not(:disabled, [aria-disabled="true"]) .reset-label { | ||
| color: inherit; | ||
| } |
There was a problem hiding this comment.
The Reset label only renders on the role="menuitem" items, which never get aria-selected and are never disabled, so only :focus can match here. Can we simplify this?
| // Match the foreground of the highlighted item's brand fill. | |
| &:is(:focus, [aria-selected="true"]):not(:disabled, [aria-disabled="true"]) .reset-label { | |
| color: inherit; | |
| } | |
| // Match the foreground of the highlighted item's brand fill. | |
| &:focus .reset-label { | |
| color: inherit; | |
| } |
There was a problem hiding this comment.
Thanks for the feedback. I've applied the suggestion.
bb5dd99 to
0c70460
Compare
|
There was a conflict while trying to cherry-pick the commit to the wp/7.2 branch. Please resolve the conflict manually and create a PR to the wp/7.2 branch. PRs to wp/7.2 are similar to PRs to trunk, but you should base your PR on the wp/7.2 branch instead of trunk. |
…d menu item (#86060) * ToolsPanel: Keep the "Reset" label visible on the highlighted menu item (#86045) * ToolsPanel: Keep the "Reset" label visible on the highlighted menu item * Chore: Update changelog with PR * Refactor: Nest the highlighted reset label rule under the default controls item * Fix: Simplify the highlighted reset label selector Co-authored-by: karthikeya-io <karthikeya01@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org> (cherry picked from commit 2b193fb) * Changelog: Link the WP 7.2 ToolsPanel backport --------- Co-authored-by: Karthikeya Bethu <82776409+karthikeya-io@users.noreply.github.com> Co-authored-by: karthikeya-io <karthikeya01@git.wordpress.org>
What?
Follow-up to #84583.
Keeps the "Reset" label readable when its ToolsPanel menu item is hovered or focused.
Why?
Since #84583, the active popup item uses a solid brand fill with a matching foreground color. The "Reset" label in the ToolsPanel options menu (for example Dimensions ⋮ → Padding) keeps its own accent color, so on the highlighted item it is blue text on a blue fill and nearly invisible.
How?
The label inherits the item's foreground color while the item is highlighted, matching how #84583 handles CustomSelectControl hints (
.item-hint) and MenuIteminfotext. Disabled items are excluded, as in the shared highlight styles. The label keeps its accent color when the item is not highlighted.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Use of AI Tools
Claude Code (Claude Opus 5.5) helped trace the regression to #84583 and write the fix and this description.