About a year ago, I published an article here (Well Color Us Surprised—This SC Can Be a Tricky Customer) that began with this opening statement:
If there is one topic that causes a lot of debate among our accessibility engineers here at TPGi, it’s the Success Criterion (SC) 1.4.1 Use of Color. On the face of it, it seems like a simple one.
Looking back, I feel like that should have been ‘If there are two topics that cause…’. Because while SC 1.4.1 Use of Color is, indeed, a tricky one to get your head around, we often spend a lot of time deliberating over SC 1.4.11 Non-text Contrast, and in many cases find ourselves thinking “Well, this issue could be either of these, or maybe both!”
It’s been a little while coming, but I had intended to write this as a follow-up (or rather a companion piece) to the Use of Color article ever since the proverbial ink dried on that one. And once again, I’ve decided that ‘dry and dull’ is not the order of the day, so let’s roll up another quiz format and set you all loose on these examples.
Note that where examples have colors in them, I have provided a handy grayscale button that will remove all colors from that test, giving you a way of better appreciating how these examples might be perceived for people with low vision or color blindness.
Also worth mentioning: the question “Does it fail 1.4.11?” is based on what you see in each example’s default state. If there is a change in style, color, whatever when the element receives focus, does that change your thinking on anything or lead you to fail it for a different SC?
As before, a quick check to see if you want to go all in on the quiz format:
All the Dubiously Named Tests
- Test 1: I’m blue, Da ba dee da ba di
- Test 2: Electric Bluegaloo
- Test 3: Offsetting Makes You Feel Good
- Test 4: Chonk if You Love Cheeses
- Test 5: If I Really Focus, I See Red
- Test 6: Witness the Thickness
- Test 7: This Is a Little Gray Ting
- Test 8: Gray Textpectations
- Test 9: Gray Doubt
- Test 10: I Don’t Mean to Be Negative But…
- Test 11: These Buttons Are Giving Me Pause for Thought
- Test 12: Shifty Shades of Gray
- Test 13: It’s What’s Inside That Counts
- Test 14: Testing the Boundaries
- Test 15: Starry, Starry Light
- Test 16: Star, That’s What They Call You
- Test 17: Different Strokes for Different Folks
- Test 18: I Can’t See Clearly Now the Line Has Gone
- Test 19: Living in a Box
- Test 20: It’s Default of da Browser
Test 11: These Buttons Are Giving Me Pause for Thought
What we’re looking at here is a collection of controls against a dark background which, this time, have no high contrast text inside that might provide a cheeky little pass (through 1.4.3 conformance). This time it’s all down to the graphics. So (drum roll) … is this going to be a symbolic win for 1.4.11?
Does this pass or fail 1.4.11 Non Text Contrast?
- As with the buttons with text inside, don’t get too hung up about the border color having a low contrast ratio (1.26:1, in case you were wondering). What’s happening with the symbols inside?.
- The actual control graphic—the stop, play, or record symbol—is white against either a completely black background inside the button (21:1 contrast ratio) or if you compare to the background outside the button boundary it’s a 15.91:1 contrast ratio. Whatever you measure it against, the symbols are easy to perceive.
Test 12: Shifty Shades of Gray
I’ve already made the case that I am not a designer. These boring old buttons add more fuel to that argument. No wait, there’s no argument at all. But do these buttons pass or fail 1.4.11? Or anything else (apart from the ‘do these buttons look pig-ugly’ test)?
Does this pass or fail 1.4.11 Non Text Contrast?
- This is where it can get a bit contentious. What, specifically, are you measuring here for contrast?
- The button border color against the background? That would fail at 1.26:1.
- The graphic (square, triangle, circle) against the page background? That would just fail at 2.77:1.
- Or the graphic against the button background?
- In this case, I would pass it on the basis that the key part of the control—which is the symbol that denotes what action the button will do—is a medium/light gray against a black button background, and the background has enough padding/space around the symbol for it to provide the contrast, which is 3.66:1.
- Would you pass it on that basis? Or do you think this is a bad call? Over to the comments section you go!
- A quick mention of 1.4.1 Use of Color – it passes that too, as the unfocused and focused state border colors have a comfortable 4.43:1 contrast ratio.
Test 13: It’s What’s Inside That Counts
I would be the worst pub quiz host ever. I’d be like “Welcome to the Spice Girls round where we’ll be asking pop music questions from the 90s … First question: which band’s debut single was called ‘Wannabe’?” Or, in other words, there’s a BIG FAT CLUE in this test’s title. Again. So, you know the drill … does it pass 1.4.11?
Does this pass or fail 1.4.11 Non Text Contrast?
- Well, there’s a nice contrast on the button border—like 21:1, highest you can get—so why isn’t this a pass?
- While the border has good contrast, you need to remember that it’s what that button will do that is most important, not necessarily what the shape of it is. You can clearly see a circular shape, but can you clearly see what the buttons do?
- Each button graphic (#666) sits on a button background (#222) that provides a contrast ratio of just 2.77:1. Therefore low vision users will likely only be able to tell that you have a collection of buttons that have a nice clear border but heck knows what’s inside each one.
Test 14: Testing the Boundaries
This is the last in our collection of transport controls. Not the kind of transport controls like, for example, stopping vehicles crossing a border. But clearly there is a border control issue with this example. As in, there is no border whatsoever. Surely this can’t be a good thing? This must indicate a failure in the system somewhere. Or does it …
Does this pass or fail 1.4.11 Non Text Contrast?
- This is almost exactly the same as Test 11, in that what we really care about is whether the graphic part (stop, play, record) has good contrast.
- The border color? Well, there is no border here. The button background (#000) has very low contrast with the page background (#222) of just 1.32:1. But the button boundary is not really the issue here.
- The graphic (#fff) has the highest possible contrast against the button background (#000) of 21:1, and a very high contrast (15.91:1) if measured against the page background. However you measure it, these icons are clear to see.
- The lack of the border does mean that it may not be clear where the boundaries are, but the graphic elements are a decent size, and there is margin space between the buttons so even if you cannot see the button boundaries clearly, there is little chance you might accidentally trigger an incorrect adjacent control on a touch screen, for example. Now, had these controls had minimal space between, like a single pixel, and there was little padding in the control, the chances for error would be much greater and the lack of a clear boundary could be a real issue for someone to be know where to click.
Test 15: Starry, Starry Light
I think we’ve all encountered this sort of thing before: the old star rating for a product. If there’s one thing we know about stars it’s that they are very, very bright objects that you cannot possibly see against a light background, and yet this seems to be something that many web designers fight against. If you get this one wrong, I might just explode like a supernova.
Does this pass or fail 1.4.11 Non Text Contrast?
- Of course it fails. That one was waaaaay too easy. Light yellow against white? That’s a measly 1.3:1 contrast ratio.
- Oh, and it also fails 1.4.1 Use of Color, as the contrast between the filled/unfilled stars is under 3:1 contrast ratio and there is no other way of deriving this information.
Test 16: Star, That’s What They Call You
Same shape, different hue: but is it enough to make the example below pass? Orange is a notoriously tricky color to work against light backgrounds, as many an organisation that has orange as a corporate color has found after an accessibility audit. But we’re veering just beyond orange and into ‘rust’ territory.
Does this pass or fail 1.4.11 Non Text Contrast?
- A comfortable 4.08:1 color contrast means it has no trouble with passing Non-Text Contrast.
- It also passes 1.4.1 Use of color because the two star types are easily discernible.
Test 17: Different Strokes for Different Folks
“But I really need to have yellow stars! Who has orange stars, after all?”
OK, fine, you can have your yellow stars if you must but we’ve learned from test 15 that these won’t pass the 3:1 contrast ratio threshold. Unless …
Does this pass or fail 1.4.11 Non Text Contrast?
- By providing a black outline on the stars, the star shape can clearly be seen against the white background. That’s a whopping 21:1 contrast ratio.
- There is still a 1.4.1 Use of Color failure though (as the low contrast of the filled to unfilled stars means that some people will just see a row of 5 identical stars).
Test 18: I Can’t See Clearly Now the Line Has Gone
We appear to have taken a step back here. “Isn’t this exactly the same as test 15?” I hear you say. Well, it’s almost the same. The images are exactly the same but there’s been something added. How does that affect things?
Does this pass or fail 1.4.11 Non Text Contrast?
- “As with test 15, this fails 1.4.11 due to the poor contrast,” is what I originally wrote before being alerted to an error on this test.
- The addition of the text “3 out of 5 stars” does mean that even if the stars cannot be perceived by some people, there is an alternative that is clear to read (passes SC 1.4.3 Contrast (Minimum) and can be scaled because it’s real text (so no SC 1.4.5 Images of Text failure, either).
- It passes 1.4.1 Use of Color because color is no longer the only mechanism that indicates what the rating is.
- The main reason why this does not fail 1.4.11 is because the presence of that text means that this image is no longer “Required for Understanding”. As the Understanding SC 1.4.11 Non-text Contrast explains it (edited down to the significant parts): “If a person needs to perceive a graphic … in order to understand the content it should have sufficient contrast. However, that is not a requirement when: … The information is available in another form”.
- A case of ‘Textual Healing’, if you will.
Test 19: Living in a Box
Content that is organised on a page in handy little boxes sure helps to visually group related items, whatever might be inside those boxes. But what if those boxes have low contrast borders, like the example below. Would you fail it?
Here are some things
You might need to do one of the following:
You may also need to do this:
Does this pass or fail 1.4.11 Non Text Contrast?
- A classic case of this being a usability issue for all rather than an accessibility issue that fails any specific WCAG success criterion.
- The box outline has a low contrast of 1:9 against the white background. If someone had difficulty perceiving that border, would it really be a problem? You can see for youself by pressing the ‘Remove the border’ button above.
- Note that this does not affect the layout/grouping – there’s just a little more space around the sections if you cannot perceive the border, and spacing is in itself a mechanism for visually indicating how items relate to each other.
- From Understanding SC 1.4.11 Non-text Contrast (and with emphasis added on the elements that this does apply to): “The intent of this Success Criterion is to ensure that active user interface components (i.e., controls) and meaningful graphics are distinguishable by people with moderately low vision.”
Test 20: It’s Default of da Browser
What if you were just to do nothing? Nothing at all. No styles on your buttons, form inputs and what have you. Would a form input fail 1.4.11? Or anything else?
For this example we need to embed a Codepen (otherwise the form inputs will just inherit all the styles that are defined on this site).
See the Pen Example of form with no styling (for TPGi article) by TPGi (@TPG)on CodePen.
Does this pass or fail 1.4.11 Non Text Contrast?
- The default border of the inputs above might be fine in your browser. Or they might be awful (sorry, Apple, but the text inputs in Safari/macOS are an absolute horror show!). But if these are the browser defaults, they cannot fail 1.4.11, no matter how bad they are.
- If you were to apply a custom style for the border and it’s under the 3:1 contrast ratio, then you will have failed 1.4.11 (ironically, even if you actually improved the default slightly—I’m looking at you again, Safari—you will notch up a failure).
- Similarly, if you don’t apply a custom focus style to elements and you leave it up to the browser default even if it’s a really poor style, it can’t fail SC 2.4.7 Focus Visible.
- It’s worth noting that default focus styles vary A LOT across browsers. To drum that in even further, macOS users are able to set custom colors in System Settings which are then adopted by some browsers. The image below shows three example colors (red, yellow, green) and how that renders as a focus style in Safari. Oh … and now double that because the user could have light mode or dark mode set!
- And here’s how three Mac browsers (Edge, Firefox and Safari) render the focus outline with the user having set a green accent color:
- If you really want to be sure you are meeting the required color contrast ratios there’s only one thing for it: take back control of your borders!
We’re all done here—how did you do?
You’ve been keeping scores, right? Right? OK, maybe not—there was a lot to get through there. Hopefully you found it educational and also got through the terrible puns and questionable humor unscathed.
Did anything really surprise you? Or did you find any of the examples to upset you enough in your disagreement that you feel like writing a strongly-worded missive to the author? If that is the case, just scroll down a short way and let us know in the comments.
Until the next time that we use this format on another particularly tricky success criterion (any suggestions?), enjoy the rest of your day, or what little there is left after this mammoth-sized post!
Comments
Please do a follow-up that shows best practices, to contrast against “these are mostly awful, some technically pass”.
Thanks for the prompt, Chris. The intention here was to provide examples that often trip us up in audits, causing mis-attribution to one or another SC and to explain the reasons why. But you’re right, an antidote to this providing some examples of how to do it right would be good. I allude to one example in here of using multiple box shadows to crete a focus indicator that will work against all backgrounds, and an article that has best practices would be a good place to demonstrate that.
Why is there a hidden button in Test 20 with the text “Skip results iframe”
This looks to be something that CodePen adds in (which I have no control over). It is definitely not part of the test/examples.
Is it ironic that the form fields on this entry are such low contrast that, emulating low contrast vision (Chrome rendering tools), they are invisible? The B9 border against the FFF is 1.96:1, the lighter grey inside is only 1.07:1 against the white background or 1.83:1 against the border. While I can see them, I don’t have low vision, but someone who does may have issues finding the fields.
You’re not wrong, Danielle. I will pass this on to the site devs (this is not under my control as a mere author, but I know the right people to poke in the ribs to get it addressed).