1.4.1 Use of color: adding examples to understanding text - #3717
1.4.1 Use of color: adding examples to understanding text#3717detlevhfischer wants to merge 33 commits into
Conversation
Adding two examples for using color in focusing elements, one for links that have an additional underline and one for buttons where the background color changes and focused ansd unfocused background habve a contrast difference equal or better than 3:1.
patrickhlauke
left a comment
There was a problem hiding this comment.
Would be great to provide a small image with each of these to illustrate the point (but yes, I know this is always a bit of a pain to do)
|
@patrickhlauke Agree. I have added illustrations. The text probably needs some further tweaking. |
|
@detlevhfischer could you be on the TF call next Friday (8 March)? As has been the pattern, probably alastair or Michael will be screen sharing but we would like you (or someone who has reviewed) to walk the group through the PR. |
I think for a link in blue that has sufficient contrast to a white background AND 3:1 to the surrounding text (assumed to be black here), it would not even be possible to find a color on focus that both has 3:1 or better to the unfocused state AND maintains 3:1 or better to the surrounding text. Showing that this will not work so that some other differentiator (underline, bold or whatever) is needed would be the point for inline links. |
|
@bruce-usab I'll try to be on the Friday call next week. |
scottaohara
left a comment
There was a problem hiding this comment.
some suggested wording changes / alt text updates for the added graphics
| <h3>Focus on links</h3> | ||
| <p>A block of text has a text link in blue that has a contrast of 3:1 to the surrounding text. When this link receives keyboard focus, it turns into a darker blue. The contrast difference between the link color in the focused and the unfocused state is only 2.0:1. In addition, after receiving focus the contrast difference between the link and the surrounding text is now also well below 3:1. To show the keyboard focus clearly, the link is in addition underlined, so the change of color is not the only indicator of keyboard focus. Without an additional focus indicator the example would fail the Success Criterion 1.4.1 Use of Color.</p> | ||
| <figure id="figure-text-links"> | ||
| <img src="img/textlink.svg" alt="A blue inline text link in a block of black text, before and after receiving keyboard focus" width="500" /> |
There was a problem hiding this comment.
| <img src="img/textlink.svg" alt="A blue inline text link in a block of black text, before and after receiving keyboard focus" width="500" /> | |
| <img src="img/textlink.svg" alt="Two instances of the same paragraph of text containing a hyperlink. The first instance shows the unfocused hyperlink with blue colored text with no underline. The second instance shows the same hyperlink in the focused state, now with darker blue text and an underline" width="500" /> |
|
I must be missing something with this, as F73, "Failure of Success Criterion 1.4.1 due to creating links that are not visually evident without color vision", seems to contradict it. In this PR, we're saying that a link with no default underline can pass Use Of Color if it gets an underline on hover and/or focus. F73 seems to contradict that:
Example 2 in F73 seems to back that up: an inline link with no underline, but that gets an underline in its hover state, fails. Am I missing something obvious? |
|
@fstrr the scenario here says that the non-underlined link is a color that passes the 3:1 ratio against the non-hyperlink text. so that's why it would be a pass. maybe it'd be good to call out that even though this is a pass, it is still generally not recommended. edit: edit again:
and this passing technique - which links to these passing examples all seems to demonstrate that F73 needs to be fixed. |
Co-authored-by: Scott O'Hara <scottaohara@users.noreply.github.com>
Co-authored-by: Scott O'Hara <scottaohara@users.noreply.github.com>
Co-authored-by: Scott O'Hara <scottaohara@users.noreply.github.com>
Co-authored-by: Scott O'Hara <scottaohara@users.noreply.github.com>
This PR removes example 2, “Removing the underline from a link in a sentence or paragraph without providing another visual cue besides color”, which contradicts guidance in G183. This issue came up in #3717.
in response to @fstrr s comment, in the paragraph preceding the illustration of the inline link, I changed contrast value of default link color to surrounding text color to 3.8:1. I also added the actual value of 2.0:1 between link color and surrounding text after the link receives focus,
|
@fstrr Does my latest change of contrast values in the text preceding the illustration of inline link in default and focused state and the addition of a note on required underline contrast address your concerns? |
Changed "just under 4:1" in the fig legend to the actual value of 3.8:1 (because it is also used in the text above the illustration).
Added a note that the underline must have at least 3:1 contrast.
corrected typo
|
@detlevhfischer Thanks for this. A couple of things:
And, as it's a note, should it be marked up as a note? Thanks :) |
| the numbers.</p> | ||
|
|
||
| <h3>Focus on links</h3> | ||
| <p>A block of text has a text link in blue that has a contrast of 3:1 to the surrounding text. When this link receives keyboard focus, it turns into a darker blue. The contrast difference between the link color in the focused and the unfocused state is only 2.0:1. In addition, after receiving focus the contrast difference between the link and the surrounding text is now also well below 3:1. To show the keyboard focus clearly, the link is in addition underlined, so the change of color is not the only indicator of keyboard focus. Without an additional focus indicator the example would fail the Success Criterion 1.4.1 Use of Color.</p> |
There was a problem hiding this comment.
| <p>A block of text has a text link in blue that has a contrast of 3:1 to the surrounding text. When this link receives keyboard focus, it turns into a darker blue. The contrast difference between the link color in the focused and the unfocused state is only 2.0:1. In addition, after receiving focus the contrast difference between the link and the surrounding text is now also well below 3:1. To show the keyboard focus clearly, the link is in addition underlined, so the change of color is not the only indicator of keyboard focus. Without an additional focus indicator the example would fail the Success Criterion 1.4.1 Use of Color.</p> | |
| <p>A blue text link has a contrast of 3:1 with the surrounding block of black text, and so is not relying on color alone. However, when this link receives keyboard focus, it turns a darker blue. The contrast between the link color in the focused and the unfocused state is only 2:1. In addition, after receiving focus the contrast difference between the link and the surrounding text is now also well below 3:1. To show the keyboard focus clearly, the link is in addition underlined, so the change of color is not the only indicator of keyboard focus. Without this additional focus indicator the example would fail the Success Criterion 1.4.1 Use of Color.</p> |
|
Looking at this again on today's call, the "Focus on links" is problematic... |
|
It needs an update:
|
|
I'm going to work some more on this PR (hope that's ok, @detlevhfischer). My initial thinking is:
|
✅ Deploy Preview for wcag2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Resolved merge conflicts. Latest preview https://deploy-preview-3717--wcag2.netlify.app/understanding/use-of-color |
|
@kfranqueiro wondering if we should prevent spellcheck from going into |
remove all the inkscape etc cruft
…d' into 1.4.1-examples-added
Adding two examples for using color in focusing elements with the keyboard, one for links that have an additional underline, and one for buttons where the background color changes and focused and unfocused background have a contrast difference equal to or better than 3:1.
Background: The Understanding Text of 1.4.11 Non-Text Contrast has Figure 15 where it says:
There is so far no example how 1.4.1 applies to keyboard focus states so this might be helpful.