Complete the lesson quiz and earn 250 XP.
In traditional product teams, accessibility (a11y) is often treated as an afterthought—an eleventh-hour audit before launch that results in rushed, fragile fixes. Teams test screens individually and repeatedly miss basic errors like missing labels or unreadable contrast.
A design system transforms accessibility into a systemic multiplier:
Button or ModalDialog component is fully WCAG-compliant (proper contrast, focus management, ARIA roles, and screen reader announcements), every product squad inheriting that component is compliant automatically.The Web Content Accessibility Guidelines (WCAG) 2.1 and 2.2 are organized around four fundamental principles, known as the POUR framework:
Color contrast measures the luminance ratio between foreground text (or interactive icons) and the background surface. Low contrast creates severe barriers for people with low vision, color vision deficiencies, or users viewing screens in bright sunlight.
Under WCAG 2.1 Level AA (the global industry standard):
Pro Tip: In your design system, bake these ratios directly into your semantic color tokens (e.g., text-muted must be pre-validated to pass 4.5:1 against bg-surface).
One of the most catastrophic mistakes in web design is removing the browser's default outline using CSS outline: none without providing an accessible alternative. Without a visible focus indicator, sighted keyboard users cannot tell which element currently has focus.
A modern design system provides a dedicated focus ring token:
2px offset (outline-offset: 2px or a double-ring shadow) so the ring does not blend into the component border.:focus-visible): Use CSS :focus-visible so focus rings appear for keyboard navigation (Tab/Arrow keys) but remain discreet during mouse clicks.When a modal dialog or drawer opens, it demands the user's immediate attention. If focus is not managed properly, two severe accessibility bugs occur:
Tab cycles behind the modal into the obscured background page, confusing screen reader and keyboard users.<body> tag rather than returning to the button that triggered the modal.A governed modal component must implement a Focus Trap:
Tab on the last interactive element wraps focus back to the first element in the modal.Escape closes the modal immediately and restores focus to the triggering element.ARIA (Accessible Rich Internet Applications) is a set of attributes that supplement HTML to convey roles, states, and properties to assistive technologies.
However, the First Rule of ARIA states:
'If you can use a native HTML element or attribute with the semantics and behavior you already require, then do so instead of re-purposing an element and adding an ARIA role, state or property to make it accessible.'
For example:
<div onClick={submit} role="button" tabIndex={0}>Submit</div> (requires manual keypress handlers, focus styling, and state management).<button type="submit">Submit</button> (native keyboard support, enter/space triggers, disabled state, and native accessibility tree representation out of the box).Tiny buttons and close icons that are easy to click with a high-precision desktop mouse become frustrating and unusable on touchscreens or for people with tremors or motor impairments.
WCAG 2.1 and 2.2 specify clear Target Size guidelines:
up event (finger lift), allowing users to drag away before releasing to cancel an unintended tap.Dynamic animations, smooth parallax scrolling, and flashy page transitions can look stunning to many users, but for individuals with vestibular disorders, they cause physical dizziness, nausea, and vertigo.
Modern operating systems (macOS, iOS, Windows, Android) include a user setting called Reduce Motion.
A design system honors this preference using the CSS media query @media (prefers-reduced-motion: reduce):
@media (prefers-reduced-motion: reduce) {
* {
animation-duration: 0.01ms !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}
In the design system, motion tokens should automatically evaluate this preference, replacing sweeping zooms and slide-ins with subtle cross-fades or instant state transitions.
Screen reader users (navigating via VoiceOver on macOS/iOS, NVDA or JAWS on Windows, or TalkBack on Android) do not read an entire webpage top-to-bottom sequentially. Instead, they scan interfaces using landmarks and heading hierarchies.
Essential structural rules include:
<header>, <nav>, <main>, <aside>, and <footer> rather than generic <div> tags.<h1>, followed logically by <h2> and <h3> without skipping levels (e.g., jumping directly from <h1> to <h4>).sr-only): Provide visually hidden text for icon-only buttons (e.g., <button><X /><span className="sr-only">Close dialog</span></button>).Review this real-world form field implementation in a legacy codebase:
<div class="field">
<div class="label">Work Email</div>
<input placeholder="Enter work email" style="border: 1px solid #E0E0E0;" />
<span class="error" style="color: #F87171;">Invalid email address</span>
</div>
This input has four severe accessibility flaws:
<div> with no for or id link to the input.#E0E0E0) has a 1.2:1 contrast ratio against the white background (violating the 3.0:1 non-text rule).aria-invalid attribute.aria-describedby is missing).