-
Notifications
You must be signed in to change notification settings - Fork 265
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
1.4.1 Use of color: adding examples to understanding text #3717
base: main
Are you sure you want to change the base?
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some suggested wording changes / alt text updates for the added graphics
understanding/20/use-of-color.html
Outdated
<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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<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 <[email protected]>
Co-authored-by: Scott O'Hara <[email protected]>
Co-authored-by: Scott O'Hara <[email protected]>
Co-authored-by: Scott O'Hara <[email protected]>
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.
A small patch to clarify one aspect of #3717
The styles get removed anyway at publication time, but this makes it easier when previewing the in-flight PR
Swapped out base.css for editors.css for better previewing |
Nice, thanks for all the good edits! In a separate step, it's perhaps a good idea to still add a paragraph undo "Intent of Use of Color" so the example chimes with something explained before, as @u9000-Nine has hinted at. |
What I think would be useful would be to have the Focus On Links image match the ratios in the preceeding paragraph. I found that having two almost identical examples, one in text and one as an image, next to each other a little confusing. In last week's backlog meeting, I think we discussed adding a note stating that if the example's underline was under 3:1 contrast, that would be a Non-Text Contrast issue. If I'm remembering that correctly, adding that would also be useful. |
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 :) |
understanding/20/use-of-color.html
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<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:
|
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.