Problem/Motivation
On the regional settings page (/admin/config/regional/settings) in the Default time zone select list the optgroup labels styling isn't applied in all browsers leading to a too low color contrast. Tested on MacOS 10.13.6 (High Sierra) with
Firefox 98.0.2

Chrome 99.0.4844.83 (Fails SC 1.4.3)

Safari 13.1.2 (Fails SC 1.4.3)

I was unable to find the CSS color for the optgroup label and only used the color picker to check the color contrast for the label so it is not the exact ratio but the label color for chrome and and safari is around `#C6C5CB` which leads to a contrast of ~ `1,7:1` but the goal is `4,5:1`. In Firefox with bold italic optgroups it meets the success criterion with ease.
Steps to reproduce
1. go to /admin/config/regional/settings
2. click Default time zone
3. scroll to labels
| Comment | File | Size | Author |
|---|---|---|---|
| optgroup_safari.png | 34.46 KB | rkoller | |
| optgroup_chrome.png | 33.87 KB | rkoller | |
| optgroup_firefox.png | 39 KB | rkoller |
Comments
Comment #2
rkollerComment #3
rkollerComment #4
mherchelI don't think it's possible to style the
<optgroup>labels (at least within Chromium).<select>elements have always been notoriously difficult to style, and the styling that happens either involves replacing the element with something custom (a route that we will not go down), or just styling the "closed" state. It looks like<optgroup>is the same.Comment #8
mgiffordThis sounds like an upstream browser support issue. Is there an upstream issue for optgroup lists in Chrome or Safari? Great that Firefox supports it.
Tagging for https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html