Contrastproof
Writing

The parts of your interface that need 3:1, and the parts that need nothing

4 min read

Key takeaways

  • Non-text parts of an interface need 3:1 against what is next to them, not the 4.5:1 body text needs.
  • WCAG 1.4.11 covers the visual information required to identify a control and its state, and the parts of a graphic required to understand it.
  • It explicitly exempts inactive controls, appearance the browser decides and the author did not change, and anything not required to understand the content.
  • Applying 4.5:1 to a focus ring or a disabled button is the commonest way a compliant interface gets redesigned for no reason.
  • Focus indicators have a second, stricter rule in WCAG 2.2: 2.4.13 Focus Appearance, at level AAA, which also sets a minimum indicator area.

The number is 3:1, and it is not the text number

Body text needs 4.5:1. Almost everything else that carries meaning needs 3:1. WCAG 1.4.11 Non-text Contrast, at AA, is the criterion, and it covers two families of thing.

  • User interface components. The visual information needed to identify a control and its current state. The border of an empty input, an unchecked checkbox, the off position of a toggle, a focus ring.
  • Graphical objects. The parts of a graphic you need in order to understand it. A line on a chart, an icon carrying meaning on its own, the filled portion of a progress bar.

A common grey border sits right on the line. This one is the kind of value that ends up in a component library because it looks fine on a designer's monitor.

A typical light input border, measured against the page
#d4d4d8 on #ffffff16px · 400 · needs 4.5:11.48:1fix #77767a (4.51:1)

Nowhere near 3:1. Every input on the product is failing, and no contrast report aimed at text will ever mention it.

What the criterion deliberately leaves alone

This is the half nobody publishes, and it is the half that saves work. The criterion carves out several things, and they are in the normative text rather than being anyone's interpretation.

ThingRequirementWhy
A disabled controlNone1.4.11 excepts inactive components. Greying out is how a control says it cannot be used.
Browser-default appearanceNoneExcepted where the appearance is set by the user agent and the author has not modified it.
A purely decorative ruleNoneOnly parts of a graphic required to understand the content are covered.
Text inside a logoNone1.4.3 exempts logotype text outright, and a brand mark is not something a ratio should redraw.

The decorative exemption has an edge that matters. A rule between two paragraphs is decoration. The moment a line is the only thing telling you where one control ends and the next begins, it is carrying information and it is covered.

Focus indicators have a second rule

A focus ring is a component state, so 1.4.11 applies at 3:1. WCAG 2.2 added a second criterion aimed specifically at focus: 2.4.13 Focus Appearance, at AAA.

2.4.13 goes further than contrast. It also asks that the indicator be at least as large as a set area, roughly the perimeter of the component at a minimum thickness, which rules out the popular one-pixel outline that technically contrasts and practically vanishes.

Two other 2.2 criteria are about focus and are often confused with these, so they are worth naming: 2.4.11 and 2.4.12 Focus Not Obscured are about whether a sticky header covers the focused element. They are not contrast rules.

Checking a part of an interface

The awkward thing about 1.4.11 is that the answer depends on what the element is, and no generic color checker asks you that. A grey at 2.4:1 is a failing input border, an acceptable decorative divider, and a perfectly correct disabled button, all at the same value.

Focus and UI checkPick the element, get the right requirement for it, including the ones with no requirement at all.

Where this usually bites

  • Input and select borders in a light theme, which are almost always too pale.
  • Unchecked checkboxes and radios, where the only thing identifying the control is the outline.
  • The off state of a toggle, which people style as a soft grey track.
  • Placeholder text, which is text and therefore needs 4.5:1, not 3:1. This one is the reverse mistake.
  • Chart series in a light palette, especially the third and fourth series where the palette has run out of strong colors.
  • Focus rings inherited from a framework and never checked against the surfaces they land on.

The last one is the sneakiest, because a focus ring is usually tested once, on white, and then used on cards, panels, tinted rows and dark mode, where its contrast against the thing behind it is a different number entirely.

Common questions

What contrast do buttons and borders need?
3:1 against what is adjacent to them, under WCAG 1.4.11 Non-text Contrast at level AA. This is lower than the 4.5:1 body text needs, and applying the text figure to interface parts is a common source of unnecessary redesign.
Do disabled buttons need to meet contrast requirements?
No. WCAG 1.4.11 excepts inactive components. Raising a disabled control's contrast to 3:1 tends to make it look available again, which removes information the low contrast was carrying.
What contrast does a focus indicator need?
3:1 against the adjacent background under 1.4.11 at level AA. WCAG 2.2 adds 2.4.13 Focus Appearance at level AAA, which asks for the same contrast plus a minimum indicator area, so a single hairline outline generally will not satisfy it.
Does a divider line need 3:1?
Only if it carries information. 1.4.11 covers parts of a graphic required to understand the content, so a purely decorative rule between two paragraphs is exempt, while a line that is the only thing separating two controls is not.

Find out which of these your own site does.

Free, no account, under 30 seconds.