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
Improve color contrast for default colors and UI elements #1258
Comments
If we could agree on default colors for some common callouts, it should be possible to predefine those callouts in (S)CSS. Configured callouts for the same names would override the default colors.
Currently, the theme supports callouts with all the colors defined by the theme: We might need to restrict the set of approved/default callout colors to ensure AAA in both our default Footnotes
|
I think the stock set (when looking at CSS/UI Frameworks like Bootstrap and Bulma) are:
This aligns relatively closely with the pre-existing callout colours that are used in our version of the theme / you originally proposed. So, overall I'm quite satisfied with the overall idea behind the current set! I think the improvements we should make are likely around the opacity for the background, which in turn will resolve the color contrast issues. For example, Bootstrap's Alerts maintain high contrast ratios while using a single hue, which is pretty close in design to our approach. So, I think with some tweaking of our existing color palette, we can achieve the goal we're looking for. I'm unsure if I'll be able to find good defaults for both And yes, definitely agreed that we should still allow users to pick custom colors; extra opacity settings may be useful, though I could also see this being done purely in SCSS. I'll see if I can dedicate some time into a PoC for this (i.e. picking some colors, and putting up a draft PR). Let me know if you have any other thoughts! |
In kevinlin1/just-the-class#32, a user of @kevinlin1's just-the-class theme has correctly observed that our theme packages a button theme that doesn't pass accessibility standards.
In particular, my guess (from looking at the linked website) is that it's our blue button; the
#227efa
default doesn't pass the WCAG AAA guidelines.I've raised accessibility concerns in various issues across the repo (ex #566, #870). To make this issue more narrow, I'd like to propose a new guideline for our theme colors: any default element we package with the theme should meet WCAG AAA guidelines (at least, until the APCA ones come out).
This would include:
In addition, while we don't bundle callouts by default, many users do use them; thus, I think they should be included in this list too.
At a cursory glance, I don't think this should be too big of a change (many of our colors are close to the ~4.5:1 ratio). Implicitly, I'm benchmarking against WCAG AAA Large instead of the AA for UI components (from my perspective, buttons have always fit in the former category than the latter).
That being said, I may be missing something - glad to get some more input on this! I'll likely get a draft PR in the next week or so.
The text was updated successfully, but these errors were encountered: