Chapter 8 · Accessibility
Revision sheet
Every lesson's idea and recap on one page. Read it before an interview, or print it.
-
8.1Accessibility Overview
Perceivable, operable, understandable, robust — four principles that cover every rule you'll ever be given.
- POUR: perceivable, operable, understandable, robust.
- Semantic HTML solves most of it before ARIA is needed.
- Permanent disability is the smallest share of the people this helps.
-
8.2Keyboard Accessibility
Everything clickable must be reachable by Tab, activatable by Enter or Space, and visibly focused.
- Reachable, activatable, visible — the three keyboard requirements.
- Tab order comes from the DOM; positive
tabindexis always the wrong fix. - Custom widgets inherit the full key contract of the thing they imitate.
-
8.3Screen Reader
Semantics decide what gets announced — ARIA patches the gaps, and wrong ARIA is worse than none.
- Name, role, state, value — every control needs all four.
- Semantic HTML gives them free; ARIA only patches genuine gaps.
- Live regions must exist before their content changes.
-
8.4Focus Management
When the UI changes, you must decide where focus goes — the browser only gets it right on full page loads.
- Every UI change is a focus decision; the browser only handles full page loads.
- Save the trigger, trap inside modals, restore on close.
- Focusing a removed element silently sends the user back to the top.
-
8.5Color Contrast
4.5:1 for body text, 3:1 for large text and UI controls — and colour must never be the only signal.
- 4.5:1 body, 3:1 large text and UI, both themes checked.
- Colour is never the only carrier of meaning.
- Focus rings and text-over-image are the two most commonly missed cases.
-
8.6Accessibility Tools
Automation finds about a third of real issues — know exactly which third, and cover the rest by hand.
- Automation catches static markup issues; humans catch flow, order, and meaning.
- Keyboard-only testing is the highest-value 30 seconds in the whole discipline.
- Gate the automatable part in CI so it never regresses.
-
8.7How to fix accessibility
Audit, triage by user impact, fix at the component level, then gate it so it can't come back.
- Triage by user impact, never by scanner count.
- Fix at the component and token layer — patching pages is a treadmill.
- Verify with keyboard and screen reader, then gate in CI.
Capstone
Make a custom dropdown fully accessible. Document every role, every key binding, and where focus goes on open, select, and close.