-
-
Notifications
You must be signed in to change notification settings - Fork 850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Insufficient contrast between background and UI elements in dark mode #2091
Comments
Im going to defer to @lindsaym-fa (our designer) on this one! |
We are using higher contrast input borders in Web Awesome, and I think it's worth adjusting in Shoelace, too. I'm on it. ✔️ Thanks, @danny-andrews and @KonnorRogers! |
Absolutely valid points, @b-d-m-p. It would be a simple change to bump up the default contrast for help text in dark mode, so I'll take point on that. Thanks for bringing it up! Regarding the challenges getting colors right between light and dark mode with the current color palettes, I hear you. We've reimagined theming in Web Awesome (both Free and Pro) to make color accessibility easier. Some of that includes redesigning the primitive color palettes to have predictable contrast ratios and introducing a sort of "switch" layer of semantic color tokens that can easily change between (and be specifically tailored for) light and dark modes. The goal is to make component styling more intuitive and require fewer manual overrides. All of that is in alpha testing now. Because reworking the theming API was a pretty significant breaking change, we have that ready for the transition from Shoelace 2.x to Web Awesome 3.0. It's a bummer that we can't bring those changes to you sooner, but I hope you can rest assured that we understand that pain point and are working to make that experience better. |
@lindsaym-fa Thanks for the detailed explanation! That's great! I'm in no hurry. I just figured fixes here would get added to Web Awesome. That gives me more of a reason to check out the alpha. I'd love to see what approaches you used to accomplish those things. 😃 |
Describe the bug
The default border color between UI elements (buttons, inputs, cards, etc.) and their background has very poor contrast, and doesn't meet the WCAG requirements for non-text contrast.
Right now, the default border for such elements is
--sl-color-neutral-300 = #43434A
, and the default background is--sl-color-neutral-0 = #1A1A1E
. This amounts to a very low contrast ratio of 1.76:1 using WCAG and Lc -8.3 using APAC:This doesn't look too bad in isolation, but on a big screen with lots of elements, I find it very difficult to distinguish the boundaries of various elements.
Bumping the border color up to
--sl-color-neutral-400 = #56565F
gives us a contrast ratio of 2.38:1 in WCAG and Lc -15.4 (just above the bare minimum of 15+) but is at least sufficient to distinguish elements from their background:Additional information
From #708, I understand full AA contrast compliance may be pursued through a
prefers-contrast
option. However, I still think the default dark mode should at least have enough contrast to be widely usable out of the box.Thanks for your thoughts and for the great component library!
The text was updated successfully, but these errors were encountered: