-
Notifications
You must be signed in to change notification settings - Fork 249
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
Does a two-color focus indicator pass SC 2.4.11 if it contrasts itself? #3026
Comments
If I understand the new SC correctly, your two-color focus indicator would not satisfy the SC. If the contrasts between the two colors were higher (e.g. black and white in the indicator) the SC would always be fulfilled. |
Maybe it is an anti-aliasing effect but when I look at these closely none have a 1px white ring as part of the focus indicator. Even if it did, for the middle example neither of the colors gets you to a 3:1 contrast ratio for the same pixels. |
The key part for these examples is:
So an indicator contrasting with itself does not intrinsically pass, because we are looking for a change of contrast.
You've picked examples just on the border of the contrast threshold, so that's not really the case (at least for users with visual impairments). If you do have a higher contrast pair, like the Chrome/Edge black and white indicator (but outside the component) then you are pretty much guaranteed to pass. |
According to the SC wording, the focus indicator is not sufficient. However, the question is why? Maybe the new SC is not good enough. After all, the focus indicator should be sufficient because it has sufficient contrasts (3:1) in itself and is thus recognizable as an object. |
That would allow for a dark button on a white background to have a light grey outline, e.g. the first image example in this article. |
I agree that per the SC wording, it's not sufficient. I think https://w3c.github.io/wcag/techniques/css/C40 suggests otherwise incorrectly, though (emphasis mine):
We should probably update it to be more clear that the technique doesn't guarantee a pass without consideration of the page/components it's being used with, and to overhaul its test procedure accordingly. (also s/ |
I started looking into rewriting the technique to be more accurate. I didn't finish with the content update, but I did want to write down a quick proof of why I think the actual requirement for the indicator colors' contrast with one another is 9:1, rather than 3:1. I don't think the technique needs to include such a proof, but I thought it might be helpful for discussion purposes. Note that this is only applicable for a case where the indicator is being evaluated against a single, flat background color; the wording in the technique would need be careful about applicability in cases where the indicator overlays a background with multiple colors in play (for example, image backgrounds, gradient backgrounds, indicators that are partially inset over the component being indicated). Proof that for a two-color indicator to meet 3:1 change contrast with any single flat background color, the two indicator colors must meet 9:1 contrast with each otherNote: the proof below uses GitHub's MathML syntax; some screen readers require a plugin to announce it correctly. For example, NVDA users may need to install MathPlayer. Suppose the two colors of a two-color indicator have relative luminance values In order for any possible background color of a page to meet 3:1 change contrast with one of the two indicator colors, it is both necessary and sufficient for
|
Per discussion in today's meeting, there was agreement on:
|
Rewrite technique C40 and associated example per discussion in #3026
Update approved: https://www.w3.org/2023/05/09-ag-minutes.html#t05 |
Success Criterion 2.4.11 Focus Appearance (Minimum) (Level AA): When a user interface component has keyboard focus, the focus indicator:
In the screen below you can see a button with an outer focus indictor composed of:
One of the requirement is: has a contrast ratio of at least 3:1 between the same pixels in the focused and unfocused states.
With the grey background example the contrast of the blue or white rings is not high enough. However the blue and white constituent parts of the indicator contrast themselves which ensures this state change is always highly distinguishable for users.
Does this combination of contrasting colors for the focus indicator allow this UI component to pass the requirements for success criteria 2.4.11 regardless of the background color?
The text was updated successfully, but these errors were encountered: