# Accessibility and Inclusive Design ## Overview This skill provides a systematic framework for creating universally accessible interfaces that work for everyone, regardless of ability, situation, or context. **Core Principle**: Accessibility constraints make design BETTER for everyone, not just users with disabilities. High contrast helps in sunlight. Large touch targets help when distracted. Clear language helps when stressed. **Framework**: The Universal Access Model - 6 dimensions ensuring comprehensive accessibility coverage. ## When to Use Load this skill when: - User mentions "accessibility", "WCAG", "inclusive design", "screen reader" - Designing or critiquing any interface (accessibility is universal) - User asks about contrast ratios, colorblind-safe design, keyboard navigation - Compliance required (legal, ethical, best practices) - Evaluating existing designs for accessibility issues **Don't use for**: Pure visual aesthetics (use visual-design-foundations first, then verify with this skill) **Critical Note**: This skill should be referenced by ALL other Lyra skills. Accessibility is not optional or separate - it's integrated into every design decision. ## The Universal Access Model A systematic 6-dimension framework for evaluating and ensuring universal access: 1. **Visual Accessibility** - Contrast, zooming, color-independent information 2. **Motor Accessibility** - Touch targets, keyboard navigation, no precision required 3. **Cognitive Accessibility** - Clear language, reduced mental load, forgiving 4. **Screen Reader Compatibility** - Semantic structure, labels, logical order 5. **Temporal Accessibility** - No timeouts, pauseable content, user-paced 6. **Situational Accessibility** - Works in varied contexts (noise, sunlight, one-handed) Each dimension has specific WCAG criteria, testing methods, and patterns. ### Dimension 1: VISUAL ACCESSIBILITY **Purpose**: Users with vision differences (low vision, colorblindness, blindness) can access content #### Evaluation Questions **Contrast:** - Does text meet 4.5:1 contrast ratio (WCAG AA)? - Does large text (18pt+) meet 3:1 ratio? - Do UI components meet 3:1 contrast against backgrounds? - Is contrast even higher for critical actions (7:1 for AAA)? **Zoom & Resize:** - Can users zoom to 200% without horizontal scrolling? - Does text remain readable when zoomed? - Do layouts reflow gracefully at high zoom levels? - Are font sizes relative (em, rem) not fixed (px)? **Color Independence:** - Is information conveyed with more than color alone? - Can colorblind users distinguish states (red/green)? - Are links distinguishable without relying on color? - Do charts/graphs use patterns in addition to color? **Readability:** - Is body text at least 16px on mobile, 14px on desktop? - Is line height comfortable (1.5x for body text)? - Is line length appropriate (45-75 characters)? - Are fonts clear and legible (avoid decorative for body)? #### WCAG 2.1 AA Requirements **1.4.3 Contrast (Minimum) - Level AA:** - Normal text: 4.5:1 minimum - Large text (18pt/14pt bold+): 3:1 minimum - UI components and graphics: 3:1 minimum **1.4.4 Resize Text - Level AA:** - Text can be resized up to 200% without loss of content or functionality **1.4.11 Non-text Contrast - Level AA:** - UI components and graphical objects: 3:1 minimum against adjacent colors **1.4.1 Use of Color - Level A:** - Color is not the only visual means of conveying information #### Patterns (Good) **High Contrast Text:** ``` Body text: #000000 on #FFFFFF (21:1) ✓ Links: #0066CC on #FFFFFF (8.6:1) ✓ Large headings: #333333 on #FFFFFF (12.6:1) ✓ ``` **Color + Icon/Text Indicators:** ``` Error: Red background + "X" icon + "Error" text Success: Green background + checkmark icon + "Success" text Warning: Yellow background + "!" icon + "Warning" text (Colorblind users see icon/text, not just color) ``` **Link Differentiation:** ``` Links: Blue (#0066CC) + underline (always visible) Or: Different font weight + underline on hover Not: Just color change (insufficient for colorblind) ``` **Zoom-Friendly Layouts:** ``` Relative units: font-size: 1rem (16px base) Viewport units: max-width: 90vw Flexible grids: display: flex with wrap Not: Fixed pixel widths everywhere ``` #### Anti-Patterns (Problematic) **Low Contrast:** ``` Light gray on white: #999999 on #FFFFFF (2.8:1) ✗ Fails WCAG AA (needs 4.5:1) ``` **Color as Sole Indicator:** ``` "Red items are errors, green items are valid" Colorblind users can't distinguish ✗ Add icons/text to each state ✓ ``` **Fixed Font Sizes:** ``` font-size: 12px; (user can't resize) Use: font-size: 0.75rem; (scales with user preference) ``` **Tiny Text:** ``` Body text at 12px on mobile (too small) ✗ Minimum 16px on mobile, 14px on desktop ✓ ``` **Insufficient Line Height:** ``` line-height: 1.0; (cramped, hard to read) ✗ line-height: 1.5; (comfortable spacing) ✓ ``` #### Testing Methods **Contrast Tools:** - WebAIM Contrast Checker: https://webaim.org/resources/contrastchecker/ - Stark plugin (Figma/Sketch): Real-time contrast checking - Chrome DevTools: Built-in contrast ratio in color picker - Accessible Colors: Suggests accessible alternatives **Colorblindness Simulation:** - Stark (Figma): Protanopia, Deuteranopia, Tritanopia filters - Colorblinding Chrome extension - Sim Daltonism (macOS): System-wide colorblind filters - Test with Protanopia (red-blind) and Deuteranopia (green-blind) at minimum **Zoom Testing:** - Browser zoom to 200% (Cmd/Ctrl + Plus) - Check for horizontal scrolling (bad) - Check for overlapping content (bad) - Check for cut-off text (bad) **Visual Testing Checklist:** - [ ] All text meets 4.5:1 contrast (WebAIM) - [ ] UI components meet 3:1 contrast - [ ] Links distinguishable without color - [ ] Zoom to 200% works without horizontal scroll - [ ] Colorblind simulation passes (Stark) - [ ] Body text minimum 16px mobile, 14px desktop ### Dimension 2: MOTOR ACCESSIBILITY **Purpose**: Users with motor control differences (tremors, limited dexterity, paralysis) can interact #### Evaluation Questions **Touch Targets:** - Are all interactive elements at least 44x44px (iOS) or 48x48dp (Android)? - Is spacing adequate between tap targets (8px minimum)? - Can users with tremors hit targets reliably? - Are critical actions away from screen edges (accidental activation)? **Keyboard Navigation:** - Can users navigate entire interface with keyboard only? - Is tab order logical (top-to-bottom, left-to-right)? - Are focus indicators visible (2px outline minimum)? - Can users activate all functions via keyboard? - Are keyboard shortcuts provided for common actions? **No Precision Required:** - Can users interact without fine motor control? - Are drag-and-drop operations optional (alternative method)? - Are hover-only interactions avoided? - Can users pause/cancel actions (no irreversible quick gestures)? #### WCAG 2.1 AA Requirements **2.1.1 Keyboard - Level A:** - All functionality available via keyboard interface **2.1.2 No Keyboard Trap - Level A:** - Focus can move away from component using keyboard alone **2.4.7 Focus Visible - Level AA:** - Keyboard focus indicator is visible **2.5.5 Target Size - Level AAA (Best Practice):** - Touch targets at least 44x44 CSS pixels (iOS guideline, WCAG AAA) #### Patterns (Good) **Large Touch Targets:** ``` Buttons: min-height: 48px, min-width: 48px Icons: 44x44px clickable area (icon may be smaller, hit area large) Form inputs: height: 48px List items: min-height: 56dp (Android Material) ``` **Adequate Spacing:** ``` Margin between buttons: 8px minimum Padding inside buttons: 12px vertical, 24px horizontal Space between form fields: 16px minimum ``` **Visible Focus Indicators:** ``` button:focus { outline: 2px solid #0066CC; outline-offset: 2px; } Do not: outline: none; (removes accessibility) ✗ ``` **Keyboard Shortcuts:** ``` Common actions: - Tab: Next element - Shift+Tab: Previous element - Enter/Space: Activate button/link - Esc: Close modal/dismiss - Arrow keys: Navigate menus/lists Custom shortcuts: - Cmd/Ctrl+S: Save - Cmd/Ctrl+Z: Undo - /: Focus search (common web pattern) ``` **Skip Links:** ``` Allows keyboard users to skip repetitive navigation ``` #### Anti-Patterns (Problematic) **Tiny Touch Targets:** ``` Buttons: 30x30px (too small, frustrating) ✗ Minimum 44x44px (iOS), 48x48dp (Android) ✓ ``` **Crowded Tap Targets:** ``` Buttons with 2px spacing (accidental taps) ✗ Minimum 8px spacing between interactive elements ✓ ``` **No Focus Indicator:** ``` *:focus { outline: none; } ✗ Keyboard users can't see where they are Keep default or enhance: outline: 2px solid blue; ✓ ``` **Hover-Only Interactions:** ``` Dropdown menu appears only on hover (keyboard inaccessible) ✗ Add keyboard trigger: click or Enter key ✓ ``` **Illogical Tab Order:** ``` HTML order: Header → Sidebar → Content Visual order: Header → Content → Sidebar Tab order follows HTML (confusing) ✗ Reorder HTML or use tabindex carefully ✓ ``` **Mouse-Only Actions:** ``` Right-click context menus only (no keyboard equivalent) ✗ Provide button or keyboard shortcut alternative ✓ ``` #### Testing Methods **Keyboard Navigation Test:** 1. Unplug/hide your mouse 2. Navigate entire interface with Tab, Shift+Tab, Enter, Space, Esc, Arrows 3. Check: - Can you reach all interactive elements? - Is focus indicator always visible? - Is tab order logical? - Can you activate all functions? - Can you escape modals/menus? **Touch Target Testing:** - Use browser DevTools to measure elements (should be 44x44px minimum) - Test on actual mobile device (finger test) - Try tapping with thumb while holding phone (reachability) **Motor Accessibility Checklist:** - [ ] All touch targets 44x44px minimum - [ ] 8px spacing between interactive elements - [ ] Entire interface navigable via keyboard only - [ ] Focus indicators visible on all interactive elements - [ ] Tab order is logical - [ ] No hover-only critical interactions - [ ] Keyboard shortcuts for common actions ### Dimension 3: COGNITIVE ACCESSIBILITY **Purpose**: Users with cognitive differences (dyslexia, ADHD, anxiety, memory issues) can understand #### Evaluation Questions **Language Clarity:** - Is language simple and clear (8th grade reading level)? - Are sentences short (20 words or less)? - Is jargon avoided or explained? - Are instructions direct and actionable? **Cognitive Load:** - Is information chunked (5-7 items per group)? - Are headings and lists used to organize content? - Is progressive disclosure used (simple first, advanced later)? - Are users required to remember information across screens? **Error Prevention & Recovery:** - Are errors prevented with constraints and validation? - Are error messages clear and helpful? - Can users easily undo mistakes? - Are confirmations provided for destructive actions? **Visual Clarity:** - Is layout consistent across screens? - Are visual cues provided (icons, color, spacing)? - Is there adequate white space (not overwhelming)? - Are animations purposeful (not distracting)? #### WCAG 2.1 AA Requirements **3.1.5 Reading Level - Level AAA (Best Practice):** - Text does not require reading ability more advanced than lower secondary education **3.2.3 Consistent Navigation - Level AA:** - Navigational mechanisms that are repeated occur in same order **3.2.4 Consistent Identification - Level AA:** - Components with same functionality are identified consistently **3.3.1 Error Identification - Level A:** - Errors are identified and described to user in text **3.3.2 Labels or Instructions - Level A:** - Labels or instructions provided when content requires user input **3.3.3 Error Suggestion - Level AA:** - Suggestions provided when input error is automatically detected **3.3.4 Error Prevention (Legal, Financial, Data) - Level AA:** - Submissions are reversible, checked, or confirmed #### Patterns (Good) **Clear Language:** ``` Good: "Enter your email address" Bad: "Input your electronic mail identifier" Good: "Delete this file?" Bad: "Permanently remove this resource from the filesystem?" Target 8th grade reading level (Hemingway Editor) ``` **Chunked Information:** ``` Group related fields: ┌─────────────────────┐ │ Contact Information │ │ - Name │ │ - Email │ │ - Phone │ └─────────────────────┘ Not: 15 fields in one long list ``` **Progressive Disclosure:** ``` Default view: Basic settings (3-5 options) "Advanced" button reveals: Power-user settings Not: All 30 settings visible at once (overwhelming) ``` **Helpful Error Messages:** ``` Good: "Email format incorrect. Example: name@example.com" Bad: "Invalid input in field 3" Good: "Password must contain: 8 characters, 1 number, 1 uppercase" Bad: "Password requirements not met" ``` **Confirmation for Destructive Actions:** ``` User clicks "Delete Account" Modal: "Are you sure? This will permanently delete your account and all data. Type 'DELETE' to confirm." Prevents accidental data loss ``` **Visual Hierarchy:** ``` Use headings, spacing, color to create structure: - H1: Page title (32px, bold) - H2: Section headers (24px, bold) - H3: Subsections (18px, bold) - Body: Content (16px, regular) - Spacing: 24px between sections ``` #### Anti-Patterns (Problematic) **Complex Jargon:** ``` "Utilize the aforementioned methodology" ✗ "Use this method" ✓ ``` **Wall of Text:** ``` Paragraph with 200 words, no headings or lists ✗ Break into sections with headings, use bullet lists ✓ ``` **Overwhelming Choices:** ``` 15 buttons on one screen (decision paralysis) ✗ 1 primary action, 1-2 secondary, hide rest in menu ✓ ``` **Cryptic Errors:** ``` "Error 4032" (user has no idea what to do) ✗ "Email already in use. Try logging in instead." ✓ ``` **No Confirmation for Destructive Actions:** ``` Single click deletes account (disaster) ✗ Confirmation modal with type-to-confirm ✓ ``` **Inconsistent Patterns:** ``` "Save" button top-right on page 1, bottom-left on page 2 ✗ Consistent placement across all screens ✓ ``` #### Testing Methods **Readability Testing:** - Hemingway Editor: Checks reading level (aim for grade 8 or lower) - Readable.io: Analyzes content complexity - Read text aloud: If it sounds awkward, rewrite **Cognitive Load Testing:** - Count choices per screen (5-7 max before chunking) - Measure form fields (chunk into logical groups) - Check memory requirements (can user see info they need to reference?) **User Testing:** - Watch users complete tasks (where do they hesitate?) - Ask users to explain what they think will happen (mental model check) - Test with users with cognitive disabilities if possible **Cognitive Accessibility Checklist:** - [ ] Language at 8th grade level or lower (Hemingway) - [ ] Sentences short (20 words or less) - [ ] Information chunked (5-7 items per group) - [ ] Error messages clear and actionable - [ ] Destructive actions require confirmation - [ ] Consistent navigation and patterns - [ ] Adequate white space and visual structure ### Dimension 4: SCREEN READER COMPATIBILITY **Purpose**: Users with screen readers (NVDA, JAWS, VoiceOver, TalkBack) can navigate and understand #### Evaluation Questions **Semantic HTML:** - Are proper HTML elements used (button, nav, main, article)? - Is heading hierarchy logical (h1 → h2 → h3, no skipping)? - Are landmarks used (header, nav, main, aside, footer)? - Are lists used for lists (ul, ol, not divs)? **Alternative Text:** - Do images have descriptive alt text? - Are decorative images marked as decorative (alt="")? - Do icon buttons have text labels or aria-label? - Are complex images explained (charts, diagrams)? **Focus Management:** - Is focus order logical? - Does focus move to opened modals? - Is focus trapped in modals (can't escape to background)? - Does focus return to trigger element when modal closes? **ARIA Labels:** - Are ARIA labels used when semantic HTML insufficient? - Are form inputs properly labeled? - Are dynamic updates announced (aria-live)? - Are expanded/collapsed states indicated (aria-expanded)? #### WCAG 2.1 AA Requirements **1.1.1 Non-text Content - Level A:** - Images have text alternatives **1.3.1 Info and Relationships - Level A:** - Information, structure, relationships conveyed through markup **2.4.1 Bypass Blocks - Level A:** - Mechanism to skip repeated blocks of content **2.4.6 Headings and Labels - Level AA:** - Headings and labels describe topic or purpose **4.1.2 Name, Role, Value - Level A:** - For all UI components, name and role can be programmatically determined **4.1.3 Status Messages - Level AA:** - Status messages can be programmatically determined and announced #### Patterns (Good) **Semantic HTML:** ```html

Page Title

Section Heading

Content here...

Not:
,