Make focus visible in every display mode

8 steps · about 2 h 37 min · Intermediate

  1. Use CSS to change presentation on focus (guide, W3C Web Accessibility Initiative, 22 min)

    Start with a technique that makes focus presentation an explicit authored state.

  2. Measure focus appearance (guide, W3C Web Accessibility Initiative, 28 min)

    Evaluate size, contrast and persistence rather than relying on a vague impression of visibility.

  3. Target modality-aware focus styling (reference, MDN Web Docs, 18 min)

    Add a strong indicator when the browser determines that focus should be evident.

  4. Highlight a focused composite region (reference, MDN Web Docs, 16 min)

    Reveal context around a nested field or control without moving focus itself.

  5. Build a non-layout-shifting indicator (reference, MDN Web Docs, 18 min)

    Use outlines without changing box dimensions or clipping the control's content.

  6. Adapt to forced colours (reference, MDN Web Docs, 20 min)

    Let system colors preserve contrast when the user's display mode overrides authored colors.

  7. Avoid disabling user colour choices (reference, MDN Web Docs, 15 min)

    Recognize the rare cases for preserving authored colors and the risk of opting out broadly.

  8. Test a two-colour focus indicator (guide, W3C Web Accessibility Initiative, 20 min)

    Use adjacent contrasting colors so the indicator survives both light and dark surroundings.