VIS-003a Never let colour be the only sign of what something means or which state it is in
- Level
- Rule
- Verdict
- Requirement
- Status
- proposed, version 1.0.1
Rule
Never let colour be the only sign of what something means or which state it is in, such as a status, an error or a selection. Add text, an icon, a shape or a pattern. A lightness difference of 3:1 counts too, except where people must know what a particular colour means.
Examples
Live examples built with Justified's components. Try them with the mouse, the keyboard or a screen reader.
Do: Every status has a word
| Branch | Status | Time |
|---|---|---|
| main | Passed | 2 min 14 s |
| fix-login | Failed | 1 min 02 s |
| docs-update | Running | 0 min 41 s |
Don't: A coloured dot for a status
| Branch | Status | Time |
|---|---|---|
| main | Passed | 2 min 14 s |
| fix-login | Failed | 1 min 02 s |
| docs-update | Running | 0 min 41 s |
bg-success, bg-destructive or bg-info says how each build went. In the grayscale copy the passed and the failed build look the same.Do: The chosen plan is marked, not only tinted
Don't: The chosen plan is only tinted
bg-card to bg-accent, a step of about 1.2:1. Choose a plan: in the coloured scene it is hard to see (about 1.2:1 in the light theme and 1.3:1 in the dark one), in the grayscale copy it is gone.Why
Many people see some colours differently, red and green most often. Others meet the page in grey: in forced-colours mode, on a dim screen, in sunlight or on a printout. For all of them a status that is only a green or a red dot says nothing. WCAG 2.2, 1.4.1 Use of Color requires that colour is not the only visual means of giving information, showing an action, asking for a response or telling elements apart. The cue has to be visible: text that only a screen reader hears does not meet it. A difference in lightness can be the cue when the two colours differ by 3:1 or more, but not when the person has to recognise the colour itself, as with red for failed and green for passed. Then text, an icon or a shape is needed. In Justified this is always the case for statuses: success, warning and destructive are all tuned to read as text on the page, so they end up close in lightness, about 1.0:1 to 1.3:1 against each other in both themes. We measure in both themes, as VIS-001 explains. Colour is welcome as an extra. The rule asks for a second cue, not for less colour. That the meaning also reaches assistive technology is a matter for 1.3.1 Info and Relationships and, for messages, FBK-004.
Do
- Show a selected option by more than its tint. On a pricing page with three plan cards, the chosen card gets a check icon and the text "Selected" as well as
bg-accent, the fill VIS-002 gives to selected items. In a toggle group, the pressed item can swap fill and text, which differs by far more than 3:1. - Give every status a word. In a build server's Builds table, the Status column reads "Passed", "Failed" or "Running", and each badge may carry an icon too (
CircleCheck,CircleX,Loader). The colour is extra. - Keep the sign on numbers that rise or fall. "+4.2 %" and "−1.3 %" keep their plus and minus signs, and an arrow up or down may stand beside them.
- Tell chart series apart without colour. In a line chart of Weekly sign-ups by plan, name each line at its end, or give the lines different dash patterns or marker shapes. A table of the same numbers below the chart also works.
- Mark free and booked slots in a calendar with a word or a symbol, not only green and red cells.
- Use different icons for different states: a filled check for done and an empty circle for not done, not one icon in two colours.
- Give the second cue enough contrast to be seen; an icon or a separating stroke needs 3:1 (VIS-004). An icon beside a word is clearer than an icon on its own, which is our own advice.
- Run a grayscale check of a new screen: everything that mattered should still be clear.
Don't
- Show a status as
<Badge className="bg-green-500" />with no text, or as a colouredsize-2 rounded-fulldot in a table cell. - Use
variant="destructive"andvariant="secondary"badges that both read "Active", or that show only a number, so that colour carries the difference. - Mark a field as wrong with
aria-invalid:border-destructiveand nothing else. The message in text is what meets the criterion; FRM-002a says where it goes. - Show which tab is active only by
text-foregroundagainsttext-muted-foreground. They differ by about 2.5:1 in the light theme and 2.1:1 in the dark one, short of 3:1. Add an underline bar or a weight change. - Show a chart's legend as coloured squares only, and rely on a tooltip on hover to tell the lines apart. The chart at rest must already make sense.
- Write "Overdue items are shown in red." The instruction depends on colour as much as the items do.
- Put the meaning in an
sr-onlylabel and leave the screen with a colour only.
Exceptions
- Colour that carries nothing. Decoration, brand colour and category colours on tags that also show their name are outside the rule.
- Visited links. A visited link may differ from an unvisited one by colour alone. Links in running text are VIS-003b, which comes first where both apply.
- Colour as the data. In a heat map or a map coloured by value, a pattern on every cell is rarely practical. Give the values another way instead: on the cells, in a table, or in a legend that names each step together with values the keyboard can reach.
- Neighbouring rules. The error text at a field is FRM-002a, the required marker FRM-005, the current page in a menu NAV-002b, the danger button DLG-005, and focus shown by more than colour KBD-001. The contrast of icons and strokes is VIS-004. A selected or on look kept visible under hover, focus and press is VIS-008b.
Verdict
Requirement. Only the judges decide; the expert witnesses are shown but do not vote. How verdicts work
| Source | Role | Stance | Page |
|---|---|---|---|
| WCAG 2.2 | Law | Requires | 1.4.1 Use of Color |
| WCAG 2.2 | Law | Supports | 1.4.11 Non-text Contrast |
| WCAG 2.2 | Law | Supports | 1.3.1 Info and Relationships |
| Material Design | Judge | No position | |
| Apple Human Interface Guidelines | Judge | Supports | Color Accessibility Charts |
| Carbon Design System | Judge | Supports | Accessibility: Color Status indicators Tag usage |
| GOV.UK Design System | Expert witness | Supports | Tag |
| Nielsen Norman Group | Expert witness | Supports | 5 Visual Treatments that Improve Accessibility, by Kelley Gordon |
Each stance links to the page it rests on, read on the date in the source register. This page never repeats what a source says; read the source itself.
History
- Version 1.0.1, : Points to VIS-008b for a selected look kept under hover, focus and press.
- Version 1.0.0, : First version.
Last checked against the other rules for conflicts on .
More in Colour and motion: 11 rules and 0 guidelines · All rules
Justified is an independent project. It is not affiliated with, sponsored or endorsed by the organisations whose guidance it cites. Read the full statement.
Apple is a trademark of Apple Inc., registered in the U.S. and other countries and regions.