Back to Blog
July 10, 2023·14 min read

Accessibility-First Development: Designing for the Margins

Accessibility(a11y) drives innovation.By designing for constraints, we often build better products for everyone.The "Curb Cut Effect" proves that features designed for the disabled(like curb cuts for wheelchairs) end up benefiting everyone(parents with strollers, travelers with luggage).Accessibility is not a "nice to have"; it is a fundamental quality metric of your codebase.

Accessibility First Development

1. The "Curb Cut" Effect & The Business Case

History: In the 1970s, activists in Berkeley poured concrete into curbs to make makeshift ramps for wheelchairs.
Result: It helped wheelchairs. But it also helped parents with strollers, delivery workers with dollies, and skateboarders.
Digital Equivalent: Closed Captions. Designed for the deaf. Used by everyone in a noisy bar, a quiet library, or people learning a new language.

The Business Case:
1. Market Reach: 15% of the global population lives with some form of disability. That is a massive market segment to ignore.
2. SEO: Google is the biggest blind user on the web. It relies on semantic HTML, alt text, and clear structure to understand your content. Accessible sites rank better.
3. Legal: In many jurisdictions (EU, Canada, USA), web accessibility is a legal requirement (ADA, Section 508). Lawsuits against inaccessible websites are rising exponentially.

2. Semantics> ARIA

The First Rule of ARIA is: Don't use ARIA if a native HTML element will do.
HTML5 gives you distinct elements for almost everything.Browsers and screen readers have spent decades optimizing their interaction with these elements.

Bad(The "Div Soup"):
& lt;lt;div class="button" onClick = { ...} & gt;gt;Click Me & lt;lt; /div>
(This is a div . It has no keyboard focus, no role, and screen readers ignore it. You have to manually add tabIndex="0", role="button" , and onKeyDown handlers just to mimic a native button).

Good:
& lt;lt;button onClick = { ...} & gt;gt;Click Me & lt;lt; /button>
(This is focusable by default, handles "Enter" and "Space" keys automatically, and announces itself as a "Button").
Key Elements to Use:

  • & lt;lt; nav & gt;gt; for navigation menus.
  • & lt;lt; main & gt;gt; for the primary content (allows "Skip to Content" links).
  • & lt;lt; article & gt;gt; for self-contained posts.
  • & lt;lt; aside & gt;gt; for complementary content.

3. The Keyboard Focus Trap

The "Tab" Test: Unplug your mouse. Can you use your entire app with just Tab, Shift + Tab , Enter, and Space ?
If you can't, your app is broken. Power users and those with motor disabilities rely on keyboard navigation.

Common Pitfalls:

  • Outline: none; Designers hate the blue focus ring. But removing it makes the site unusable for keyboard users. Fix: Replace it with a custom: focus - visible style that matches your brand (e.g., a thick purple border).
  • Modals: When a modal opens, focus must be trapped inside the modal.If I keep tabbing and the focus goes behind the modal to the page background, that is a failure.Use libraries like react - focus - lock .
  • Skip Links: Add a hidden link at the very top: "Skip to Main Content." This allows users to bypass the 50 links in your mega-menu.

4. Color Contrast & Visuals

Designers love low - contrast grey text on white backgrounds.It looks "clean." It is also unreadable for millions of people(and anyone looking at their phone in direct sunlight).
Requirement: WCAG AA requires a contrast ratio of 4.5:1 for normal text (14pt) and 3:1 for large text (18pt+).
Don't rely on color alone:
Bad: "The fields in red are required." (Colorblind users won't see red).
Good: Add an asterisk (*) and explicit semantic error text: "Error: Email is required."

5. ARIA: Bridging the Gap

Use ARIA(Accessible Rich Internet Applications) attributes only when HTML fails you.
Essential ARIA Attributes:

  • aria - label : Use this for icon-only buttons (e.g., an "X" close icon). Screen readers will say "Close Modal" instead of "Image."
  • aria - expanded : Critical for hamburger menus and accordions. It tells the user if the drawer is open or closed.
  • aria - live : For dynamic content updates (like a toast notification or a chat message). aria-live="polite" announces the update without interrupting the user. aria - live="assertive" interrupts them immediately (use sparingly).

6. Automated vs Manual Testing

You cannot automate empathy, but you can automate the basics.
The Testing Pyramid for A11y:
1. Linter(ESLint plugin - jsx - a11y): Catches low-hanging fruit while you code (e.g., missing alt text, click handlers on non-interactive elements).
2. Automated Audits(Lighthouse / Axe DevTools): Catches ~30-40% of errors (contrast issues, empty links).
3. Manual Testing: The only way to catch logical errors.
Example: An image might have alt="image123.jpg".Ideally, the automation passes(it has an alt tag), but it's useless to a blind user.
Action: Download NVDA (Windows) or use VoiceOver (Mac). Close your eyes. Try to buy a product on your site. It will be a humbling experience.

7. Cognitive Accessibility

A11y is not just for the blind or those with motor impairments.It's for the anxious, the distracted, the elderly, and the neurodivergent (ADHD, Dyslexia, Autism).
Best Practices:

  • Clear Language: Avoid jargon. Use short sentences. Write at an 8th-grade level.
  • Consistent Navigation: Don't move the "Log Out" button to a different place on every page.
  • Form Labels: Don't use placeholders as labels. They disappear when you type. This strains working memory ("Wait, what was this field for?").
  • Error Messages: Don't just turn the border red. Explain how to fix the error.
  • Animation: Respect the prefers-reduced-motion media query.Some animations(parallax, zooming) can trigger vestibular disorders(motion sickness).

8. The Legal Landscape & The "Domino Pizza" Case

In 2019, the Supreme Court handed a victory to a blind man who sued Domino's Pizza because he couldn't order a pizza on their website. This set a precedent: The ADA applies to the digital world.

Global Standards:

  • USA: Section 508 (Government) and ADA Title III (Private Sector).
  • EU: European Accessibility Act (EAA) requires all e-commerce and banking apps to be accessible by 2025.
  • Canada: AODA (Accessibility for Ontarians with Disabilities Act).

Compliance is no longer optional. But compliance is the floor, not the ceiling. You should aim for usability, not just "not getting sued."

9. Mobile Accessibility Patterns

We often think of A11y as "Screen Readers on Desktop." But mobile accessibility is just as critical.

  • Touch Targets: Apple's Human Interface Guidelines recommend a minimum touch area of 44x44 points. If your "Close" icon is 12x12, users with tremors or large fingers cannot tap it.
  • Dynamic Type: Users set their preferred font size in iOS/Android settings. Your app must respect this. If you hardcode height: 50px on a button, and the user sets text size to 200%, your text will overflow and break. Use relative units (rem, em) instead of pixels.
  • Haptics: Use vibration to reinforce success/error states. This helps users with visual impairments understand "something happened" without seeing the screen.

10. Engineering Deep Dive: The Accessible Modal

Modals are the hardest component to get right. A truly accessible modal must do 3 things:

import { useEffect, useRef } from 'react';

// The 3 Rules of Modals:
// 1. Trap Focus (You can't tab outside)
// 2. Return Focus (When closed, focus returns to the button that opened it)
// 3. Aria Attributes (Tell screen readers "I am a dialog")

function AccessibleModal({ isOpen, onClose, title, children }) {
  const modalRef = useRef(null);
  const previousFocus = useRef(null);

  useEffect(() => {
    if (isOpen) {
      previousFocus.current = document.activeElement; // Save focus
      // Trap logic here...
    } else {
      previousFocus.current?.focus(); // Return focus
    }
  }, [isOpen]);
  
  return (
    <div  role="dialog"  aria-modal="true"  aria-labelledby="modal-title">
      <h2  id="modal-title">{title}</h2>
      {children}
    </div>
  );
}

11. Tools for your Belt

Don't rely on guesswork. Equip your CI/CD pipeline and your browser with these tools.

  • Stark (Figma Plugin): Check contrast right in your design file. Don't wait for dev handoff.
  • Axe DevTools (Chrome Extension): The industry standard for automated audits. The "Pro" version offers "Intelligent Guided Testing" which is worth every penny.
  • Pa11y (CI/CD): Run accessibility checks on every Pull Request. Fail the build if new errors are introduced.
  • Silktide: For comprehensive site-wide monitoring.

12. The Future: AI & Accessibility

The next frontier isn't ARIA; it's AI.
Be My Eyes: Uses GPT-4 Vision to describe the world to blind users.
Automated Remediation: Startups like AccessiBe try to "fix" your site with one line of JS. (Controversial, as they often break more than they fix).
Voice Control: Siri and Assistant are making the web hands-free.
Key takeaway: If your site is semantic, AI agents can read it. If it's a div-soup, they will hallucinate.

13. Case Study: GOV.UK

The gold standard. They don't just "support" accessibility; they design for it.
Design Principles: "This is for everyone."
The Font: They use GDS Transport, specifically designed for legibility on low-res screens.
The Copy: They banned metaphors. Instead of "Drive forward," say "Make progress." This helps autistic users and non-native speakers.
Result: They save millions in support costs because people can actually use the website.

Conclusion

Accessibility is not a checklist item for compliance; it is an empathy exercise. It forces you to build robust, resilient UI. An accessible site is faster (cleaner HTML), easier to maintain, and better for SEO.
When you build for everyone, you build better. Make accessibility a "Definition of Done" for every ticket, not a frantic fix before launch.


References & Further Reading

Accessibility-First Development: Designing for the Margins | Akash Deep