Skip to content
Tutorials Center
My learning

Topics

Lesson 22 of 36 ยท Interaction and Visual Design

Accessible Design: Contrast and Target Size

Design for everyone: WCAG contrast ratios, touch target sizes, focus order and text alternatives, with a runnable contrast checker you can try.

Accessibility means that people with disabilities can use what you design. That includes blindness and low vision, color blindness, deafness, motor limits and cognitive differences. It also includes temporary and situational limits: a broken arm, a bright sunny street, a noisy bus. Designing for the edges tends to make the product better for everybody.

The reference standard is the Web Content Accessibility Guidelines (WCAG), organized around four principles: content must be Perceivable, Operable, Understandable and Robust (POUR). This lesson focuses on the parts a designer controls directly.

Contrast

WCAG defines a contrast ratio between text and background, from 1:1 (identical) to 21:1 (black on white). Level AA, the common legal target, requires:

  • 4.5:1 for normal text.
  • 3:1 for large text (about 24 px regular or 18.7 px bold and up) and for essential UI parts such as input borders and icons.

The ratio uses relative luminance, a weighted brightness. The following stand-in implements the published formula so you can check any pair.

Python WCAG contrast checker

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

You will see that #767676 is the lightest gray that passes AA on white, and that a bright amber on white fails badly. Most design tools and browser dev tools include a contrast checker, so use one while you choose colors.

Target size

Fingers are bigger than mouse pointers. WCAG 2.2 sets a minimum of 24 by 24 CSS pixels for pointer targets (level AA), and the enhanced level asks for 44 by 44. Apple recommends at least 44 points; Material Design recommends 48 dp. Leave spacing between targets so users do not hit the wrong one.

Small vs comfortable targets

Keyboard and focus

Many people never use a mouse: screen reader users, people with tremors, power users. Design the focus order to follow the visual and logical order, keep a visible focus ring, and make sure every action can be done with Tab, Enter, Space and arrow keys. Provide a "skip to main content" link at the top of pages with long navigation.

Text alternatives and meaning

  • Informative images need a short text alternative (alt text). Decorative images get an empty alt so screen readers skip them.
  • Do not put text inside images; it cannot be resized or read aloud.
  • Use real headings in order (one top-level heading, then nested ones) so users can jump between sections.
  • Write link text that makes sense alone: "Read the pricing guide", not "Click here".
  • Label every form field with a visible label, not only a placeholder that disappears.
  • Give video captions and provide transcripts for audio.

Motion, time and cognition

  • Respect the system "reduce motion" setting; avoid flashing content (more than three flashes per second can trigger seizures).
  • Do not set short time limits without letting users extend them.
  • Use plain language, consistent navigation and clear error recovery. This helps people with cognitive disabilities and everyone in a hurry.

A quick accessibility review

Five-minute check

Contrast Text 4.5:1, big text and icons 3:1.
Keyboard Tab through everything. Is focus visible?
Zoom At 200% nothing is cut off.
Labels Fields, buttons and images have names.

Then try a screen reader on one key flow.

1 / 2

Accessibility is cheapest when built in from the first wireframe. Retrofitting it after launch is slow and expensive. See wireframing basics for where to annotate it early.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What contrast ratio does WCAG AA require for normal-size text?

    Normal text needs at least 4.5:1; large text and essential UI components need 3:1.
  2. 2. Why is a placeholder alone a poor label?

    Users lose the instruction once they type; a visible label stays.
  3. 3. Which link text is best?

    Descriptive link text makes sense when read alone, for example in a screen reader's list of links.
  4. 4. What does POUR stand for?

    POUR names the four WCAG principles.

Summary

  • WCAG AA asks for 4.5:1 contrast for text and 3:1 for large text and UI components.
  • Make targets at least 24 px (44 px is better) with spacing between them.
  • Support the keyboard with a logical order and a visible focus ring.
  • Provide alt text, real headings, visible labels and meaningful link text.
  • Respect reduced motion; avoid flashing; use plain language.

Next: Wireframing Basics