code-society-25-2

Supplemental 7: Web Accessibility (Slides)

Overview

This lesson explores web accessibility standards and implementation, covering why accessibility matters, how people with disabilities interact with technology, and practical techniques for building inclusive web applications.

Pre-work

Please review the following resources before lecture:

Running the Demo

The a11y directory contains an interactive Next.js application demonstrating common accessibility patterns and anti-patterns.

Setup and Run

  1. Navigate to the demo directory:
    cd supplemental7/a11y
    
  2. Install dependencies:
    npm install
    
  3. Start the development server:
    npm run dev
    
  4. Open http://localhost:3000 in your browser

Features

The demo includes 15 interactive examples comparing inaccessible (“Don’t”) and accessible (“Do”) implementations:

Each example includes:

Testing

The demo includes comprehensive accessibility testing. See TESTING.md for details.

Quick test commands:

cd supplemental7/a11y

# Run unit tests
npm test

# Run E2E accessibility tests
npm run test:e2e

# Run automated accessibility scan
npm run test:a11y

Test coverage includes:

Topics Covered

Why Accessibility Matters

Types of Impairments

Assistive Technologies

Web Accessibility Standards

WCAG POUR Principles

Implementation Techniques

Testing and Tools

Tools

Browser Extensions

Screen Readers

Testing Tools

Additional Resources

Standards and Guidelines

Learning Resources

Videos and Courses

Articles and Blogs

Quick Reference: Common Accessibility Patterns

Semantic HTML

<!-- Bad -->
<div class="button" onclick="submit()">Submit</div>

<!-- Good -->
<button onclick="submit()">Submit</button>

Alt Text

<!-- Content image -->
<img src="cat.jpg" alt="Orange tabby cat sleeping on windowsill">

<!-- Decorative image -->
<img src="divider.png" alt="" role="presentation">

Form Labels

<!-- Proper label association -->
<label for="email">Email</label>
<input type="email" id="email" name="email">
<a href="#main-content" class="skip-link">Skip to main content</a>
<nav>...</nav>
<main id="main-content">...</main>

ARIA Landmarks

<header role="banner">...</header>
<nav role="navigation">...</nav>
<main role="main">...</main>
<footer role="contentinfo">...</footer>

Key Takeaways

  1. Accessibility is not optional - It’s a legal requirement and ethical responsibility
  2. Start from the beginning - Build accessibility in, don’t bolt it on later
  3. Use semantic HTML first - It provides built-in accessibility
  4. Test with real users - Automated tools only catch ~30% of issues
  5. Keyboard navigation is essential - All functionality must work without a mouse
  6. Color contrast matters - Ensure text is readable for everyone
  7. ARIA enhances, doesn’t replace - Use HTML semantics first, ARIA when needed
  8. Accessible design benefits everyone - The “curb-cut effect” improves UX for all users