Opened 2 months ago
Closed 2 months ago
#65848 closed defect (bug) (fixed)
Toolbar: wrong text hover color for certain top-level nodes
| Reported by: | fushar | Owned by: | afercia |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.1 |
| Component: | Toolbar | Version: | 7.1 |
| Severity: | normal | Keywords: | has-patch commit dev-reviewed |
| Cc: | Focuses: | css, administration |
Description
Nodes such as + New, command palette, comments, have blue hover color instead of following the admin color schemes. See attached image.
Attachments (1)
Change History (16)
#1
@
2 months ago
Based on my local testing, it seems to be caused by [63009]. Can we check @afercia @joedolson?
This ticket was mentioned in PR #12968 on WordPress/wordpress-develop by @khokansardar.
2 months ago
#2
- Keywords has-patch added
Top level toolbar nodes that render a label, such as + New, the command palette, Comments, and Updates, show a hardcoded blue text color on hover instead of the color from the active admin color scheme.
What the problem was:
- [63009] removed the
:not(.mobile)qualifier from thespan.ab-labelhover rule in the color scheme styles, but the same qualifier is still present on the default rule insrc/wp-includes/css/admin-bar.css.
- That qualifier makes the default selector more specific than the color scheme one, so the hardcoded
#72aee6wins the cascade and the color scheme is ignored for these nodes.
- Only nodes that output a
span.ab-labelare affected. The surrounding hover styles, including the item background and the icons, follow the color scheme correctly, which is why the label text alone looks wrong.
What the fix does:
- Drops
:not(.mobile)from the defaultspan.ab-labelhover selector so it matches the same elements as the color scheme rule.
- Both rules then have equal specificity and the color scheme stylesheet, which loads after
admin-bar.css, wins on cascade order, exactly as it already does for the adjacent.ab-top-menu > li:hover > .ab-itemrules.
Approach and why:
- The qualifier is the outlier rather than the color scheme change. Within the same rule block, the
li.hoverselector has never carried:not(.mobile), so removing it makes the block internally consistent and restores parity between the two files.
.mobileis added fromwp_is_mobile(), so it reflects the user agent, not the viewport. The color scheme side has already applied on.mobilesince [63009], so this change makes the default styles consistent with it rather than introducing new mobile behavior in the admin.
- Below the 782px breakpoint
.ab-labelis visually hidden, so widening the default rule has no visible effect there.
Testing instructions:
- Go to Users > Profile and choose an admin color scheme other than Default, for example Modern or Ectoplasm.
- Before the patch, hover the
+ Newitem in the toolbar. The label text turns blue (#72aee6) while the item background follows the chosen scheme.
- With the patch applied, hover the same item. The label text now uses the scheme color, for example
#7b90ffon Modern and#fffon Ectoplasm.
- Repeat with the command palette, Comments, and Updates items, which also render an
ab-label.
- Confirm the Default scheme and the front end toolbar are unchanged, since no color scheme stylesheet loads there.
## Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5
Used for: Ticket analysis and code implementation. All changes were reviewed and validated by me.
---
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.
#3
@
2 months ago
Tested the patch and confirmed that it fixes the reported issue. The toolbar text now follows the selected admin color scheme on hover as expected.
Before patch:-
https://prnt.sc/Qg_jVoz2n1O2
After patch:-
https://prnt.sc/tVFJJdxwdp7K
@wildworks commented on PR #12968:
2 months ago
#4
Thank you for the PR. I apologize if I'm mistaken, but the PR description appears to be entirely AI-generated, which makes it quite verbose and difficult for a human to read. Please refer to the AI guidelines, take responsibility for AI-generated content, and revise the text to be more human-readable and easier for reviewers.
@khokansardar commented on PR #12968:
2 months ago
#5
Thank you for the PR. I apologize if I'm mistaken, but the PR description appears to be entirely AI-generated, which makes it quite verbose and difficult for a human to read. Please refer to the AI guidelines, take responsibility for AI-generated content, and revise the text to be more human-readable and easier for reviewers.
@t-hamano I've already added the Use of AI Tools disclosure in the description.
This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.
2 months ago
@joedolson commented on PR #12968:
2 months ago
#7
@itzmekhokan The problem isn't the use of AI, which you disclosed responsibly, as expected. It's the PR description itself, which is extremely verbose. It would be much appreciated if you could edit those down to only the relevant details, rather than keeping the entirety of the AI feedback.
@khokansardar commented on PR #12968:
2 months ago
#8
@itzmekhokan The problem isn't the use of AI, which you disclosed responsibly, as expected. It's the PR description itself, which is extremely verbose. It would be much appreciated if you could edit those down to only the relevant details, rather than keeping the entirety of the AI feedback.
Understood. Thanks, I've updated the PR description.
#10
@
2 months ago
- Keywords dev-feedback commit added
- Owner set to
- Status new → assigned
I reviewed the linked PR andd it looks good to me.
Marking for commit and requesting dev-feedback as per double committer sign-off workflow during RC.
#11
@
2 months ago
Agree with the commit approval. Once it's committed, I'll mark as dev-reviewed for the backport.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
blue text hover color