--- description: WCAG AA accessibility standards and patterns alwaysApply: false globs: **/*.{vue,html,jsx,tsx} --- # Accessibility Standards (A11y) ## Philosophy Accessible design is not optional. It's a fundamental requirement for building inclusive, usable applications. **Target: WCAG AA Compliance** ## Color & Contrast ### Contrast Ratios (WCAG AA) - **Normal text**: 4.5:1 minimum - **Large text** (18pt+): 3:1 minimum - **UI components**: 3:1 minimum ```html
Readable text with 21:1 ratio
Hard to read - only 1.5:1 ratio
``` ### Don't Rely on Color Alone ```html Error: Invalid input ``` ## Semantic HTML ### Use the Right Elements ```html

Article Title

Content...

``` ### Heading Hierarchy ```html

Page Title

Section Title

Subsection Title

``` ## Keyboard Navigation ### Focus Indicators **Always show visible focus states.** ```html ``` ### Skip Links ```html Skip to main content
``` ### Test Keyboard Navigation - Tab through entire page - Shift+Tab to go backwards - Enter/Space to activate buttons - Escape to close modals/dropdowns ## ARIA (Use Sparingly) **First rule of ARIA: Don't use ARIA if you can use semantic HTML instead.** ### ARIA Labels ```html ``` ### ARIA Live Regions ```html
{{ statusMessage }}
``` ## Forms Accessibility ### Label Every Input ```html ``` ### Required Fields ```html ``` ### Error Messages ```html ``` ## Touch Targets & Mobile ### Minimum Touch Target Size **WCAG Guideline: 44x44px minimum** ```html ``` ### Spacing Between Targets ```html ``` ## Motion & Animation ### Respect Prefers-Reduced-Motion ```css @media (prefers-reduced-motion: reduce) { * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } } ``` ## Screen Reader Support ### Alt Text for Images ```html Bar chart showing 25% revenue increase ``` ### Screen Reader Only Text ```css .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; } ``` ## Accessibility Checklist ### Perceivable - ✅ Text has sufficient contrast (4.5:1) - ✅ Images have alt text - ✅ Color is not the only indicator - ✅ Content works at 200% zoom ### Operable - ✅ All functionality keyboard accessible - ✅ Focus indicators visible - ✅ No keyboard traps - ✅ Touch targets at least 44x44px ### Understandable - ✅ Clear, simple language - ✅ Labels for all form inputs - ✅ Error messages are clear - ✅ Consistent navigation ### Robust - ✅ Semantic HTML - ✅ Valid ARIA attributes - ✅ Works with assistive technologies **Remember: Accessibility is not a checklist—it's an ongoing commitment to inclusive design.**