Home
Bookmarks
Leagues
LEARN
Courses
Career Paths
Assessments
Tutorials
Arcade
Glossary
GROW
Certifications
Log in
Glossary
Log inSign up
Courses/Introduction to Design Systems/Accessibility First: WCAG & Inclusive Foundations
Level 2 · Core Principles & Governance

Accessibility First: WCAG & Inclusive Foundations

15 min read
10 exercises
250 XP
PRO
Unlock with Pro

Ready to test what you learned?

Complete the lesson quiz and earn 250 XP.

Unlock quiz

Topics in this lesson

Accessibility as a Systemic MultiplierThe 4 Core Principles of WCAG (POUR)Color Contrast Standards: WCAG AA vs AAAVisible Focus Rings & Focus ManagementFocus Trapping in Modals & DialogsARIA: When to Use It and the 'First Rule of ARIA'Touch Targets & Pointer Cancellation (WCAG 2.2)Motion Sensitivity & `prefers-reduced-motion`Screen Reader Testing & Semantic LandmarksChallenge: Auditing an Inaccessible Form Field

From Course

📘
Introduction to Design SystemsBeginner · 16 lessons
Accessibility First: WCAG & Inclusive Foundations

Lesson

Accessibility First: WCAG & Inclusive Foundations

Accessibility as a Systemic MultiplierThe 4 Core Principles of WCAG (POUR)Color Contrast Standards: WCAG AA vs AAAVisible Focus Rings & Focus ManagementFocus Trapping in Modals & DialogsARIA: When to Use It and the 'First Rule of ARIA'Touch Targets & Pointer Cancellation (WCAG 2.2)Motion Sensitivity & `prefers-reduced-motion`Screen Reader Testing & Semantic LandmarksChallenge: Auditing an Inaccessible Form Field
Unlock lesson
Complete lesson and earn 250 PX
Exercise #1

Accessibility as a Systemic Multiplier

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:

  • When an accessibility engineer and designer ensure that a core 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.
  • Baking accessibility into the foundation prevents hundreds of repetitive regressions across web, iOS, and Android applications.
Exercise #2

The 4 Core Principles of WCAG (POUR)

The Web Content Accessibility Guidelines (WCAG) 2.1 and 2.2 are organized around four fundamental principles, known as the POUR framework:

  1. Perceivable: Information and user interface components must be presentable to users in ways they can perceive (e.g., text alternatives for icons, sufficient [color contrast](/glossary/contrast-ratio), captions for video).
  2. Operable: Interface components and navigation must be operable (e.g., all functionality accessible via keyboard, no trapped focus, ample time to complete tasks).
  3. Understandable: Information and operation of the UI must be clear and predictable (e.g., clear error messages, consistent navigation patterns, readable typography).
  4. Robust: Content must be robust enough to be interpreted reliably by a wide variety of user agents, including modern assistive technologies like screen readers.
Exercise #3

Color Contrast Standards: WCAG AA vs AAA

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):

  • Normal Text (< 18pt regular or < 14pt bold): Minimum contrast ratio of 4.5:1.
  • Large Text ($\ge$ 18pt regular or $\ge$ 14pt bold): Minimum contrast ratio of 3.0:1.
  • Non-Text UI Elements & Graphical Objects: Active component boundaries, form input borders, and essential icons require at least 3.0:1.
  • WCAG AAA (Enhanced Standard): Requires 7.0:1 for normal text and 4.5:1 for large text.

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).

Exercise #4

Visible Focus Rings & Focus Management

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:

  • High Contrast: The focus ring must achieve at least a 3.0:1 contrast ratio against both the component and the surrounding background.
  • Offset / Separation: Use a 2px offset (outline-offset: 2px or a double-ring shadow) so the ring does not blend into the component border.
  • Keyboard-Only Heuristic (:focus-visible): Use CSS :focus-visible so focus rings appear for keyboard navigation (Tab/Arrow keys) but remain discreet during mouse clicks.
Exercise #5

Focus Trapping in Modals & Dialogs

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:

  1. Leaking Focus: Pressing Tab cycles behind the modal into the obscured background page, confusing screen reader and keyboard users.
  2. Lost Focus on Close: When the modal closes, focus resets to the top <body> tag rather than returning to the button that triggered the modal.

A governed modal component must implement a Focus Trap:

  • When opened, focus shifts automatically to the modal's primary heading or first interactive control.
  • Pressing Tab on the last interactive element wraps focus back to the first element in the modal.
  • Pressing Escape closes the modal immediately and restores focus to the triggering element.
Exercise #6

ARIA: When to Use It and the 'First Rule of ARIA'

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:

  • Wrong: <div onClick={submit} role="button" tabIndex={0}>Submit</div> (requires manual keypress handlers, focus styling, and state management).
  • Right: <button type="submit">Submit</button> (native keyboard support, enter/space triggers, disabled state, and native accessibility tree representation out of the box).
Exercise #7

Touch Targets & Pointer Cancellation (WCAG 2.2)

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:

  • Minimum Touch Area: Interactive elements must have a target area of at least 44 $\times$ 44 CSS pixels (WCAG 2.1 AAA / iOS HIG) or 24 $\times$ 24 CSS pixels (WCAG 2.2 AA minimum with spacing).
  • Visual Size vs Hit Area: An icon can appear visually as 16px, provided its clickable hit target (using padding or pseudo-elements) spans at least 44 $\times$ 44px.
  • Pointer Cancellation: Actions should trigger on the up event (finger lift), allowing users to drag away before releasing to cancel an unintended tap.
Exercise #8

Motion Sensitivity & `prefers-reduced-motion`

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.

Exercise #9

Screen Reader Testing & Semantic Landmarks

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:

  • Use Semantic Landmarks: Wrap major page areas in <header>, <nav>, <main>, <aside>, and <footer> rather than generic <div> tags.
  • Logical Heading Hierarchy: Pages must have exactly one <h1>, followed logically by <h2> and <h3> without skipping levels (e.g., jumping directly from <h1> to <h4>).
  • Screen Reader Only Text (sr-only): Provide visually hidden text for icon-only buttons (e.g., <button><X /><span className="sr-only">Close dialog</span></button>).
Exercise #10

Challenge: Auditing an Inaccessible Form Field

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:

  1. The label is a <div> with no for or id link to the input.
  2. The border (#E0E0E0) has a 1.2:1 contrast ratio against the white background (violating the 3.0:1 non-text rule).
  3. The error message relies solely on red text color without an error icon or semantic aria-invalid attribute.
  4. The error is not announced to screen readers (aria-describedby is missing).