# Web Accessibility Reference A consolidated reference guide drawn from MDN Web Docs covering core accessibility concepts, authoring guidelines, safe browsing practices, ARIA-based widgets, and mobile accessibility requirements. --- ## 1. Accessibility Overview > **Source:** https://developer.mozilla.org/en-US/docs/Web/Accessibility ### What Is Accessibility? **Accessibility** (abbreviated as **A11y** -- "a" + 11 characters + "y") in web development means enabling as many people as possible to use websites, even when those people's abilities are limited in some way. > "The Web is fundamentally designed to work for all people, whatever their > hardware, software, language, location, or ability. When the Web meets this > goal, it is accessible to people with a diverse range of hearing, movement, > sight, and cognitive ability." -- W3C Key points: - Technology makes things **easier** for many people. - Technology makes things **possible** for people with disabilities. - Accessibility spans physical, cognitive, hearing, movement, and sight abilities. ### Core Principles 1. **Semantic HTML** -- Use correct elements for their intended purpose. 2. **Keyboard Navigation** -- Ensure full functionality without a mouse. 3. **Assistive Technology Support** -- Maintain compatibility with screen readers and other tools. 4. **Perceivability** -- Content must be perceivable through multiple senses. 5. **Operability** -- All functionality must be keyboard accessible. 6. **Understandability** -- Clear language and predictable behavior. 7. **Robustness** -- Works across diverse assistive technologies. ### Beginner Tutorial Modules (MDN Learn Web Development) | Module | Description | |--------|-------------| | What is Accessibility? | Groups to consider, tools users rely on, workflow integration | | Accessibility Tooling and Assistive Technology | Tools for solving accessibility issues | | HTML: A Good Basis for Accessibility | Semantic markup and correct element usage | | CSS and JavaScript Best Practices | Accessible implementation of CSS and JS | | WAI-ARIA Basics | Adding semantics for complex UI controls and dynamic content | | Accessible Multimedia | Text alternatives for video, audio, and images | | Mobile Accessibility | iOS/Android tools and mobile-specific considerations | ### Key Standards and Frameworks - **WCAG (Web Content Accessibility Guidelines)** -- organized into Perceivable, Operable, Understandable, and Robust categories. - **ARIA (Accessible Rich Internet Applications)** -- 53+ attributes and 87+ roles for adding semantic meaning to custom widgets. --- ## 2. Information for Web Authors > **Source:** https://developer.mozilla.org/en-US/docs/Web/Accessibility/Guides/Information_for_Web_authors ### Guidelines and Regulations #### ARIA Authoring Practices Guide (APG) - **Provider:** W3C - **URL:** https://www.w3.org/WAI/ARIA/apg/ - Design patterns and functional examples for accessible web experiences. - Covers how to apply accessibility semantics to common design patterns and widgets. #### Web Content Accessibility Guidelines (WCAG) - **Provider:** W3C Web Accessibility Initiative (WAI) - **URL:** https://www.w3.org/WAI/standards-guidelines/wcag/ - Important baseline guidelines being adopted by EU accessibility regulations. #### ARIA on MDN - Complete guides to ARIA roles, properties, and attributes. - Best practices and code examples for each role. ### How-to Guides | Guide | Provider | URL | |-------|----------|-----| | Accessibility for Teams | U.S. General Services Administration | https://digital.gov/guides/accessibility-for-teams/ | | Accessible Web Page Authoring | IBM | https://www.ibm.com/able/requirements/requirements/ | ### Automated Checking and Repair Tools #### Browser Extensions | Tool | URL | |------|-----| | HTML CodeSniffer | https://squizlabs.github.io/HTML_CodeSniffer/ | | aXe DevTools | Built into browser DevTools | | Lighthouse Accessibility Audit | Chrome DevTools integrated | | Accessibility Insights | https://accessibilityinsights.io/ | | WAVE | https://wave.webaim.org/extension/ | #### Build-Process / Programmatic Testing | Tool | Description | |------|-------------| | axe-core | Accessibility engine for automated testing (dequelabs/axe-core) | | eslint-plugin-jsx-a11y | ESLint plugin for JSX accessibility rules | | Lighthouse Audits | Programmable audit runner (GoogleChrome/lighthouse) | | AccessLint.js | Automated a11y linting library | #### Continuous Integration - **AccessLint** (https://accesslint.com/) -- integrates with GitHub pull requests for automated accessibility review. ### Testing Recommendations Simulation and testing methods to employ: - Color blindness simulation - Low vision simulation - Low contrast testing - Zoom testing - Keyboard-only navigation (disable the mouse) - Touch-only testing - Voice command testing - Testing with a **Web Disability Simulator** browser extension Best practice: **Test with real users whenever possible.** --- ## 3. Browsing Safely > **Source:** https://developer.mozilla.org/en-US/docs/Web/Accessibility/Guides/Browsing_safely ### Conditions Addressed | Condition | Common Triggers | |-----------|-----------------| | Vestibular Disorders | Motion, animations, parallax effects | | Seizure Disorders | Flashing (3+ per second), flickering, high-contrast color changes | | Photosensitivity | Color intensity, flashing, high contrast | | Traumatic Brain Injury (TBI) | High cognitive load from color processing | ### CSS Media Feature: `prefers-reduced-motion` Detects the user's OS-level preference for reduced motion. ```css @media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } } ``` CSS transition events that developers can listen to: - `transitionrun` - `transitionstart` - `transitionend` - `transitioncancel` ### Platform-Level Browser Controls | Platform | Setting | Notes | |----------|---------|-------| | Safari Desktop (10.1+) | Disable Auto-Play | Does not affect animated GIFs | | iOS Safari (10.3+) | Reduce Motion (OS Accessibility settings) | GIFs unaffected | | Firefox | `image.animation_mode` set to `"none"` | Disables all animated GIFs | | Reader Mode (various) | Content Blockers, text-to-speech, font/zoom | Reduces distractions | ### Useful Browser Extensions | Extension | Purpose | Browser | |-----------|---------|---------| | Gif Blocker | Blocks all GIFs | Chrome | | Gif Scrubber | Pause/play/scrub GIFs like a video | Chrome | | Beeline Reader | Grayscale mode, dyslexia-friendly fonts, contrast | Chrome, Edge, Firefox | ### Operating System Accessibility Features **Windows 10:** - Settings > Ease of Access > Display -- Turn off animations. - Settings > Ease of Access > Display > Color Filters -- Toggle grayscale. - Grayscale reduces cognitive load for TBI, photosensitive epilepsy, and other conditions. **macOS:** - System Preferences > Accessibility > Display -- "Reduce motion" option. ### WCAG Compliance: Success Criterion 2.3.1 **Three Flashes or Below Threshold** -- content must not flash more than three times per second unless the flash is below the general flash and red flash thresholds. ### Best Practices for Developers **Do:** - Support the `prefers-reduced-motion` media query. - Keep flashing below 3 times per second. - Provide play/pause controls for all animations. - Test with OS accessibility features enabled. **Do not:** - Auto-play videos or animations without user controls. - Use high-frequency flashing or strobing effects. - Assume all users can tolerate motion. ### Implementation Checklist - [ ] Add `@media (prefers-reduced-motion: reduce)` rules to CSS. - [ ] Disable auto-play animations when the user preference is set. - [ ] Ensure GIFs have pause controls. - [ ] Test in Windows and macOS accessibility modes. - [ ] Validate against WCAG 2.3.1 (Three Flashes criterion). --- ## 4. Accessible Web Applications and Widgets > **Source:** https://developer.mozilla.org/en-US/docs/Web/Accessibility/Guides/Accessible_web_applications_and_widgets ### The Problem Custom JavaScript widgets (sliders, menu bars, tabs, dialogs) built with generic HTML elements like `