Problem/Motivation
In forced-colors emulation on MacOS, the "hamburger" menu icon for the collapsed primary tabs (menu local tasks) does not adjust color. On a dark background, the blue icon has insufficient contrast.

I'd guess that this also applies to other platforms, but that needs confirmation.
Steps to reproduce
-
With Claro as the admin theme, go to
/admin/content. -
Do one of:
-
In Chrome or Edge, enable
forced-colors: activeandprefers-color-theme: darkemulation. - In Edge, choose a dark theme under the Page Colors setting.
-
In Firefox, change color the color settings, to get dark background, light text, and yellow links, with "Override" set to "Always".
-
In Chrome or Edge, enable
- Reduce the window size until the primary tabs collapse into a menu with the hamburger icon.
Expected
In forced-colors: active mode, the icon color should be ButtonText.
Proposed resolution
Add a media query to the SVG file for (forced-colors: active), specifying currentColor for the fill. This will allow the icon to inherit color from the parent button element in forced-colors mode.
@Curtis Wilcox also contributed to this proposed resolution.
Remaining tasks
ImplementTest on Mac- (?) Test on other platforms with system high-contrast modes
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | 3513439-after-firefox-forced-colors-dark.png | 9.85 KB | kentr |
| #13 | 3513439-after-chrome-forced-colors-dark.png | 10.05 KB | kentr |
| #13 | 3513439-after-edge-page-colors-dusk.png | 9.75 KB | kentr |
| #10 | 3513439-before-edge-page-colors-dusk.png | 9.82 KB | kentr |
| #10 | 3513439-before-chrome-forced-colors-dark.png | 10.14 KB | kentr |
Issue fork drupal-3513439
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3513439-claro-primary-tabs
changes, plain diff MR !11552
Comments
Comment #2
quietone commentedChanges are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies.
Comment #3
sandip commentedHi @kentr, i think the proposed resolution may not work in this case as that hamberger menu is a svg image so we can add
fill: linktextto its< path/>tag when forced color mode is active to fix this issue. Do you agree with it?Comment #4
kentr commented@sandip poddar:
It should work... That said, my proposal was biased because I had been working on an issue where a media query inside the
svgdidn't work.Your proposal is simpler and less invasive, and I've also learned from @Curtis Wilcox in Slack that:
ButtonTextcurrentColorwill allow the colors to inherit from the parent button which will have the correct color inforced-colorsmodeI updated the IS proposed resolution based on the suggestions from you and @Curtis Wilcox.
Comment #5
kentr commentedI'm also only finding this one instance in Claro of an inline SVG. Maybe it would be better to convert it to a background image for consistency.
Ultimately, it's up to the maintainers.
Comment #6
sandip commentedHi @kentr,
Thank you for the information. I'll proceed with raising a MR as outlined in the Proposed resolution.
That sounds reasonable to me as well. If any maintainer agrees with this suggestion, I'll be happy to revert the changes. For now, I'll go ahead and raise the MR as mentioned in point #4.
Comment #8
sandip commentedAttaching Screenshot for review.
Comment #9
smustgrave commentedSeems there is some feedback on the MR.
Comment #10
kentr commentedUpdating the IS to include other browsers.
Comment #11
sandip commentedI am working on the feedback.
Comment #12
sandip commentedPlease review the changes.
Comment #13
kentr commentedPasses testing on Mac in Edge, Firefox, Chrome.
Does protocol dictate also testing on other platforms with system high-contrast modes (such as WHCM)?
Gitlab won't let me resolve this MR comment, but it is resolved.
Comment #14
sandip commentedHi @kentr, I have marked the thread as resolved based on your confirmation.
Comment #15
smustgrave commentedBelieve feedback to addressed for this one.
Comment #16
nod_small feedback, unnecessary nesting. You can RTBC once it's fixed
Comment #17
sandip commentedI am looking into it.
Comment #18
sandip commentedI have made the suggested changes and moving this issue to RTBC.
Comment #21
nod_Committed 9031a4e and pushed to 11.x. Thanks!