Site editor: fix sidebar item hover color - #81317
Conversation
The `<Item>` component sets its own `:hover` color to the raw admin theme color. Since the SCSS module migration (#80797) that rule matches at the same specificity as ours, and it is injected at runtime so it always comes later in the cascade β our hover color never applied. The admin theme primary carries no contrast guarantee against the sidebar background, both being seeded from the same admin color scheme. On sunrise that is #ad631e text on #8d2f2c (1.8:1), which is unreadable. Bump the specificity so the intended neutral hover color wins, and drop the explicit drilldown indicator fills β `<Item>` already sets `currentColor`, so the chevron now follows the text color in every state.
|
Size Change: -154 B (0%) Total Size: 7.82 MB π¦ View Changed
|
| .edit-site-sidebar-navigation-item__drilldown-indicator { | ||
| fill: var(--wpds-color-foreground-interactive-neutral-weak-active); | ||
| } |
There was a problem hiding this comment.
This is a minor improvement. The icon now has fill="currentColor" by default, so this style is no longer necessary. See #79320
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If 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. |
|
Flaky tests detected in ce67ed5. π Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/31158534160 Focus management when using the navigation link appender in
|
|
Thanks Aki! I ran into a pretty similar specificity thing in #80845, where the From what I checked, I believe boot's navigation item has now the same specificity issue, so it should be covered with that approach as well. |
mirka
left a comment
There was a problem hiding this comment.
I think this is fine as an immediate fix. We're also trying to see if we can consolidate these styles in #81088 (comment).
|
About the specificity issues that @juanfra raised, we're currently considering whether to So I'm thinking maybe we need to |
|
Thank you all for your reviews. As a temporary solution, let's merge this. |
The `<Item>` component sets its own `:hover` color to the raw admin theme color. Since the SCSS module migration (#80797) that rule matches at the same specificity as ours, and it is injected at runtime so it always comes later in the cascade β our hover color never applied. The admin theme primary carries no contrast guarantee against the sidebar background, both being seeded from the same admin color scheme. On sunrise that is #ad631e text on #8d2f2c (1.8:1), which is unreadable. Bump the specificity so the intended neutral hover color wins, and drop the explicit drilldown indicator fills β `<Item>` already sets `currentColor`, so the chevron now follows the text color in every state. Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: juanfra <juanfra@git.wordpress.org>
The `<Item>` component sets its own `:hover` color to the raw admin theme color. Since the SCSS module migration (#80797) that rule matches at the same specificity as ours, and it is injected at runtime so it always comes later in the cascade β our hover color never applied. The admin theme primary carries no contrast guarantee against the sidebar background, both being seeded from the same admin color scheme. On sunrise that is #ad631e text on #8d2f2c (1.8:1), which is unreadable. Bump the specificity so the intended neutral hover color wins, and drop the explicit drilldown indicator fills β `<Item>` already sets `currentColor`, so the chevron now follows the text color in every state. Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: juanfra <juanfra@git.wordpress.org>
What?
Follow up to #80797
Fixes the text color of site editor sidebar menu items on hover.
Why?
#80797 migrated
ItemGroupfrom Emotion to SCSS modules. TheItemhover rule went from a single Emotion class to a two-class selector, raising its specificity to exactly match the site editor's own rule. Component styles are injected at runtime, always after the enqueuedwp-edit-sitestylesheet, so the tie is broken by source order andItemnow wins.How?
Bump the specificity of the site editor rule so the intended neutral hover color applies again. As far as I know, this is the only way to solve the problem without changing the
ItemGroupcomponent itself.Testing Instructions
Use of AI Tools
Claude Code (Opus 5) was used to investigate the root cause and draft the patch. I reviewed the result and take responsibility for it.