Repository navigation
Boot: Use the resting brand color for the current sidebar item - #87453
Conversation
The current item is a persistent selection, not an interaction state. Keep the active brand color for hover and focus, so hovering the current item also changes its color. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🤖 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: +5 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
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mamaduka
left a comment
There was a problem hiding this comment.
Looks good. Tested with couple admin color schemes.
…ress#87453) * Boot: Use the resting brand color for the current sidebar item The current item is a persistent selection, not an interaction state. Keep the active brand color for hover and focus, so hovering the current item also changes its color. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Boot: Link the changelog entry to its pull request 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?
In the Site Editor v2 sidebar, color the current item with the resting brand color. Hover and focus keep the active brand color, so hovering any item, including the current one, changes its color.
Why?
The sidebar used
foreground-interactive-brand-activefor both the current item and hover. Hovering the current item gave no feedback, and a hovered item looked like a second current item. The current item is a persistent selection, not an interaction state, so it belongs on the resting token.Note
This is mostly a change to improve the Sidebar (ie. differentiate between "selected" item and hovered/focus items) while respecting its current visual language, so that it can be merged quickly and enable #82294.
IMO as a later follow-up, we should analyize the "sidebar navigation" pattern, extract it as a UI component, and re-discuss its selected and hover/focus item states.
How?
The current item (
aria-currentordata-status="active") usesforeground-interactive-brand. The hover and focus rule comes after it, so it wins on the current item too. The classic site editor sidebar marks its current item with neutral colors and a background, so it does not need a matching change.In every admin color scheme, the current item now has less contrast than the other items, because the resting brand color is the 4.5:1 brand text step. Against the real sidebar background, it ranges from 4.63:1 in Light (
#0069A6on#E1E5E4) to 7.86:1 in Modern. In Ectoplasm it is#B8C290at 5.72:1, and the other items are#F0F0F2at 9.46:1. The current item stays bold. Reviewers: is a brand-colored current item, instead of the brightest one, the signal we want?Testing Instructions
gutenberg-extensible-site-editorexperiment and choose the Ectoplasm admin color scheme in your profile.Testing Instructions for Keyboard
Tab through the sidebar items. Each item with keyboard focus uses the active brand color, including the current item.
Screenshots
Both columns come from trunk at
5ba8aa21255. After adds this change. Each capture shows the v2 Pages screen. Pages is the current item, the pointer hovers Templates, and the other items are at rest. The labels show the measured text colors.Sidebar in the other admin color schemes
Use of AI Tools
Claude Code extracted this change from #82294, captured the screenshots, and drafted this description.