-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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
WCAG 1.4.1 Use of Color issue on active (toggled) and disabled controls #37365
Comments
@patrickhlauke Do we need to address anything from this? |
@mdo the active class should have a much stronger differentiation with the non-active class. if we're only going by a change of background, the difference between the non-active and active background should be at least a ratio of 3:1 (see the second note in https://www.w3.org/WAI/WCAG21/Understanding/use-of-color.html ... which, incidentally, i wrote) so, for the case of the blue buttons, I'm pretty sure I mentioned this ages ago when we looked at colour contrasts in general. as for forced colours, that falls outside of the scope of WCAG itself. we've been discussing separately how to address this (as this will require more thought than just for toggles here) #35941 |
in principle, the same thinking about 3:1 contrast difference also applies to disabled controls, but the risk here is to make it so light that it becomes inperceptible for instance, using for these, we can probably split the difference and find an in-between shade for disabled controls that doesn't quite have the full 3:1 ratio compared to the regular toggle, but is lighter than the current disabled style. we can then point it out in the docs, and tell authors that - depending on how they fall on the issue of "use of color" and how strictly it needs to be applied to disabled controls that also have additional hints, like not having the hand cursor when hovered (which of course doesn't count for anything on touch devices) they may choose to pick an even lighter, or different/additional, style |
incidentally, purely from a use of color perspective (as said, leaving aside the forced colors/high contrast issue), the new styles I introduced recently for the outline toggles https://getbootstrap.com/docs/5.2/forms/checks-radios/#outlined-styles is probably the best, with its distinction between "only border" and "full background" to differentiate regular and active toggles (though doesn't tackle disabled) |
this is likely something we want to tackle properly in v6, rather than v5 (together with a good forced color story) |
Thank you:) A question here about forced-color : it's not included in criterion 1.4.1: Use of Color ? Have a solid contrast difference are OK ?
|
No, 1.4.1 does not cover user adaptations like Windows High Contrast / forced contrast at this stage
As per https://www.w3.org/WAI/WCAG21/Understanding/use-of-color.html a contrast ratio of 3:1 or higher counts as not just being a "use of color" alone, so yes, solid contrast is ok. We do plan to make additional adaptations that go beyond WCAG in #35941 but for these toggle buttons, it will likely be about adding an additional border/outline or similar (something that does not rely at all on specific backgrounds/colours) |
Prerequisites
Describe the issue
Active button use only color for difference with inactive button.
It's break Level A criterion on WCAG, and it make unusuable with forced color mode
Reduced test cases
(see https://support.mozilla.org/en-US/kb/change-fonts-and-colors-websites-use#w_custom-font-color for firefox settings, i don't found settings for Chrome)
What operating system(s) are you seeing the problem on?
Linux
What browser(s) are you seeing the problem on?
Firefox
What version of Bootstrap are you using?
v5.2.2
The text was updated successfully, but these errors were encountered: