Skip to content
Goal: Proficient✓ Sources verified 2026-11-25WCAG 2.2ARIAKeyboardFocus managementResponsiveContainer queries

Accessibility and Responsive Design ​

Accessibility (a11y) lets keyboard users, screen reader users, and people with low vision or color-vision deficiencies use the product; responsive design makes the same interface work from phones to large screens. Neither is a patch before launch; both are default requirements of design and components.

Core concepts ​

ConceptMeaning
WCAG 2.2W3C's Web Content Accessibility Guidelines, a W3C Recommendation since 2023-10. Levels A / AA / AAA; products usually target AA
POURPerceivable, Operable, Understandable, Robust
Accessibility treeThe structure the browser builds from the DOM and ARIA and exposes to screen readers: role, name, state
ARIAAttributes (role, aria-*) that add semantics to the accessibility tree. Prefer native HTML elements when they can express it; wrong ARIA is worse than none
Live regionA region whose changes screen readers announce automatically; suits live status
ResponsiveLayout adapts to the viewport (media queries) or the container (container queries)

How it works ​

1. The WCAG 2.2 AA criteria that matter most in products ​

CriterionRequirementTypical problem in tool UIs
1.4.1 Use of ColorDon't convey information by color aloneStatus shown only by red/green dots
1.4.3 Contrast (Minimum)Body text contrast ≥ 4.5:1, large text ≥ 3:1Light gray secondary text
1.4.11 Non-text ContrastUI components and graphics ≥ 3:1 against adjacent colorsInput borders or chart lines too faint
1.4.10 ReflowReadable at 320 CSS px wide without horizontal scrolling (data tables and similar are exceptions)Fixed-width layouts
2.1.1 KeyboardAll functionality works from the keyboardDrag-only actions, buttons that appear only on hover
2.4.7 Focus VisibleKeyboard focus is visibleoutline: none removed the focus ring
2.4.11 Focus Not Obscured (Minimum) (new in 2.2)A focused element isn't entirely hiddenSticky footers or overlays covering the focused element
2.5.7 Dragging Movements (new in 2.2)Dragging has a single-pointer alternativeDrag-only reordering
2.5.8 Target Size (Minimum) (new in 2.2)Targets at least 24×24 CSS px (with exceptions such as spacing)Tiny icon buttons in dense tables
4.1.3 Status MessagesStatus messages are perceivable by screen readers without receiving focus"Saved" or "Task failed" never heard by screen reader users

2. Announcing live status ​

  • role="status": implicitly aria-live="polite", announced when the screen reader is idle; good for "Task finished"
  • role="alert": implicitly aria-live="assertive", interrupts immediately; use only for urgent errors
  • The live region container should already exist on the page before its content changes, otherwise announcements are unreliable
  • Don't put high-frequency changes (logs, token streams) in a live region, or the screen reader will talk nonstop. Announce only key state changes
html
<!-- Present from page load; announced when its content changes -->
<div role="status" class="sr-only" id="task-announcer"></div>

3. Focus management ​

SituationWhat to do
Opening a dialogMove focus into it; content outside can't be interacted with. Native <dialog> with showModal() handles focus containment and Esc to close
Closing a dialog / drawerReturn focus to the button that opened it
Route change (SPA)Move focus to the new page heading or main content, and update document.title
New rows inserted liveDon't steal the user's current focus
"Handle it" jumpOpen the form and focus its first field

4. Responsive: viewport vs container ​

  • Media queries adjust the overall layout by viewport width (e.g. side-by-side panes become stacked on phones)
  • Container queries let a component adapt to the width of its own container. The same "task card" switches layout automatically in a narrow sidebar vs. a wide main area, which makes components reusable
  • Dense tables on phones: keep the 2–3 most important columns plus status and move the rest to the detail view, or switch to a card list. Data tables may scroll horizontally (Reflow has an exception for them), but key actions must not be hidden off-screen
css
.task-card-wrap { container-type: inline-size; }
@container (min-width: 480px) {
  .task-card { display: grid; grid-template-columns: auto 1fr auto; }
}

In practice ​

Developer checklist ​

  • [ ] The main flow works with only Tab / Shift+Tab / Enter / Space / Esc / arrow keys
  • [ ] The focus ring is clearly visible and not covered by sticky bars
  • [ ] Every state has text or an icon, not just color
  • [ ] Icon buttons have accessible names (aria-label or visually hidden text)
  • [ ] Form errors are linked to their inputs (aria-describedby) and explained in text
  • [ ] Key state changes are announced via role="status"
  • [ ] The main flow works at 320–375px wide
  • [ ] prefers-reduced-motion is respected (see Design systems, component abstraction and motion)

How to test ​

MethodFindsLimits
axe (browser extension, @axe-core/playwright)Automatically detectable issues: contrast, missing labels, wrong ARIAAutomation finds only part of the problems; Playwright's docs also say it must be combined with manual assessment
Lighthouse accessibility scoreA quick overviewA high score doesn't mean usable
Keyboard walkthroughFocus order, keyboard traps, unreachable featuresManual
Screen readers (macOS VoiceOver, Windows NVDA)Whether names, roles and announcements make senseRequires learning the basics

Common pitfalls ​

  1. A div as a button: no keyboard support and no role. Use <button>, or add role, tabindex and key handlers (not recommended).
  2. outline: none with no replacement focus style. Use :focus-visible to show focus rings only for keyboard use.
  3. ARIA overuse: redundant roles on native elements, or aria-hidden="true" on focusable elements.
  4. Creating a live region and writing to it immediately: some screen readers won't announce it.
  5. Small screens just shrink everything: text and targets get too small and tables collapse.
  6. Testing only in desktop Chrome: check at least once in Safari on iOS.

Common interview questions ​

  1. Which AA criteria did WCAG 2.2 add compared with 2.1?
  2. How do screen reader users perceive live task status? What's the difference between role="status" and role="alert"?
  3. How should focus be handled when a dialog opens and closes?
  4. When do you use media queries vs. container queries?
  5. How do you handle dense tables on phones?
  6. Can automated accessibility testing replace manual testing?
  • Agent Run Console: accessibility and the 375px small-screen layout in D14–15; key states announced via role="status"; status labels carry both an icon and text.
  • This site: already responsive with light and dark themes; run the checklist above with axe and a keyboard walkthrough and fix what turns up.

Sources ​

Vin Amory · AI development × content creation · Technical notes cite official docs in each page’s sources section