The Vertical orientation button on the right side of the admin menu at large screen sizes (or at the bottom of the admin menu when the menu is already vertically oriented)

has insufficient color contrast when it is not hovered or not focused. The SVG icon's color is set to #bebebe while the background-color is #f5f5f5

When it IS hovered, the SVG icon's color is set to #787878 with the same background color #f5f5f5, which is better, and matches the other icons in the menu

I believe it is this way because this is the only icon in the menu without associated text ... So, the icons that DO have associated text don't have a color change on hover because instead the associated text gets underlined. This one, without associated text, needs a color change on hover to indicate focus/active.
The question is, if the SVG icon color starts at the darker #787878, then what does it transition to on hover/active/focus, as there isn't really an analogous situation as far as I can tell. This is also slightly complicated by the fact that the background color for this one section of the menu is #f5f5f5 rather than #ffffff in the rest of the admin menu, which makes it harder to achieve "good" color contrast with the same icon colors.
Again, the icons are SVGs with a fill attribute specified on their path elements, so that's likely where it should be changed:
core/misc/icons/787878/push-left.svg
core/misc/icons/bebebe/push-left.svg
which are then referenced in:
core/modules/toolbar/css/toolbar.icons.theme.css
core/themes/stable/css/toolbar/toolbar.icons.theme.css
| Comment | File | Size | Author |
|---|---|---|---|
| #28 | Screen Shot 2023-02-12 at 5.14.22 PM.png | 160.78 KB | smustgrave |
| #27 | Before Patch.png | 8.79 KB | rinku jacob 13 |
| #27 | Afterpatch.png | 14.64 KB | rinku jacob 13 |
| #26 | 3047746-26.patch | 8.24 KB | gauravvvv |
| #24 | After_Patch.PNG | 4.33 KB | gaurav-mathur |
Comments
Comment #2
bhogue commentedComment #3
bhogue commentedComment #4
bhogue commentedComment #5
bhogue commentedComment #6
bhogue commentedComment #7
bhogue commentedComment #8
bhogue commentedComment #9
bhogue commentedComment #10
mgiffordThis is a WCAG 2.1 issue. Good to fix, but just noting that.
Comment #11
bhogue commentedGood call, thank you mgifford
Comment #12
andrewmacpherson commentedThe relevant WCAG 2.1 criterion is "1.4.11 Non-text contrast".
It needs 3:1 contrast with the background.
What are the contrasts for the colours currently used?
Adding this to a parent issue.
Comment #13
dafink commentedCould we make this so that the default color is #787878 and have the hover b3 #666666? Or does this have to match a style guide?
Comment #14
lanny heidbreder commentedPatch attached. I chose two colors that already had icon folders: #787878 and #505050. Exactly 3:1 ratio would be #8e8e8e, and these are darker.
The #bebebe version of this icon is orphaned now, I believe; there aren't any other uses of it in Drupal Core that I'm aware of. I'm not sure whether it's a good idea to just delete a tiny asset that developers might have used who-knows-how. I can reroll with the deletions committed if others think that's best.
Comment #15
andrewmacpherson commentedCan we see screenshots please?
Comment #16
lanny heidbreder commentedHere's a comparison of the unhovered state. Top is before, bottom is after. The new hover state is darker than the new unhovered state.
Comment #17
lanny heidbreder commentedComment #23
gaurav-mathur commentedComment #24
gaurav-mathur commentedPatch #14 applied successfully on on Drupal 9.4.8.The looks good for me.
Refer to screenshots.
Comment #26
gauravvvv commentedThis icon comes from Claro theme. I feel so this issue is of Claro.
I have attached a path for same. Please review.
Comment #27
rinku jacob 13 commentedI have reviewed patch #26 for drupal version 10.1.x. Actually this icon is in both olivero and claro theme(i didn't checked in other themes).But for only claro it is happening.Adding Screenshots for the reference
Comment #28
smustgrave commentedTested it passes using https://www.tpgi.com/color-contrast-checker/
With the fix it is passing.
Comment #29
lauriiiWhile Claro is shipping some Toolbar CSS, the current Toolbar designs are not specific to Claro. I think this should be also fixed within the Toolbar module.
Comment #32
quietone commentedThe Toolbar Module was approved for removal in #3476882: [Policy] Move Toolbar module to contrib.
This is Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
The deprecation work is in #3484850: [meta] Tasks to deprecate Toolbar module and the removal work in #3488828: [meta] Tasks to remove Toolbar module.
Toolbar will be moved to a contributed project before Drupal 12.0.0 is released.
Comment #33
quietone commentedToolbar module has moved to contrib.
Comment #34
quietone commented