Web Accessibility
Erik Aybar
What is Web Accessibility?
Definition varies from person to person and context
*Intro question on A11y Rules podcast
Building digital products and services in a way that enables the largest audience possible to use them. Specifically removing barriers for people with disabilities.
- Designing and developing with disabilities in mind
- Benefits not limited to only people with disabilities
a11y = Accessibility
a1234567891011y
#a11y
Saves typing. Saves typos.
a11y
Why am I talking about a11y?
- It matters
- It's neglected
- Something I've been learning about recently
- To raise awareness and spark discussion
Disabilities Affecting Web
- Blindness and limited vision
- Deafness
- Color blindness
- Limited mobility
- Unable to use mouse
- Unable to use keyboard
- Cognitive and learning disabilities
Screen Readers
- Used by blind and low vision users
- Vast majority of users are NVDA / JAWS on Windows
- VoiceOver on Mac (Activate via CMD + F5)
- Also on mobile devices (VoiceOver iOS)
- 2-dimensional text-only navigation
*everything is next/prev there is no up/down/left/right
Keyboard-only users
- Unable to use a mouse
- Also benefits keyboard preference users
Keyboard navigation as a starting point
- If it's not navigable by keyboard it isn't accessible
- But! Navigable by keyboard doesn't mean it is accessible
- Turn off your mouse and work through a user flow!
Demo!
Color Blindness
Color contrast matters
Other assistive technologies
- Screen magnification tools
- Switch inputs (limited mobility)
- Motion and eye tracking
- Braille display
- More...
Why should I care about a11y?
You are a decent human
- You care about other humans
*Humans includes people with disabilities - Your job is to create products that create value for users
*Users includes people with disabilities - As the creator of these products you have the power to make them accessible for your users
Legal reasons
- ADA (Americans with Disabilities Act) can apply to websites (details are fuzzy)
- International regulations vary (can be stricter)
- Wouldn't build a store without accessible entrance
- Number of lawsuits are growing every year
ADA Title III Accessibility Lawsuits
Number of ADA lawsuits nearly tripled from 2017 to 2018
ADA is fuzzy on the details for website compliance, but "reasonable accommodation" is expected.
Source: Seyfarth Shaw law firm
2017: 814 ➡️ 2018: 2,258
Domino's Lawsuit
Image source: iStock
Even Beyoncé's website!
You are a
Decent
Human!
Good Business Sense
- Competitive advantage
- Underserved market share
- Good PR
- Looks good. Feels good. Is good.
About 56.7 million people — 19 percent of the US population — had a disability in 2010, according to a broad definition of disability, with more than half of them reporting the disability was severe
U.S. Census Bureau report: Americans with Disabilities: 2010
U.S. with disability > Population of Canada
About 8.1 million people had difficulty seeing, including 2.0 million who were blind or unable to see.
U.S. Census Bureau report: Americans with Disabilities: 2010
In addition, they make up a significant market of consumers, representing more than $200 billion in discretionary spending
Improved UX for everyone!
Benefits machines too!
An active focus on accessibility can indirectly:
- Help with SEO
- Lead to more testable UIs
- Autofill, password managers, etc...
What can I do?
0) Educate yourself
- Invest a small amount of time exploring the topic
- Subscribe to related resources
- Install axe or Accessibility Insights browser extension
- Audit sites you use (takes mere seconds)
- Audit projects you've built
- Audit current projects
- Get these conversations started. Nobody is an expert. We all have a lot of knowledge gaps here.
- Share your learnings. Educate your team/company.
Deque's
axe browser extension
Microsoft's
Accessibility Insights
Find "your" resources
-
https://a11yproject.com/ (quick reference)
Great checklist and patterns sections - https://developer.mozilla.org/en-US/docs/Web/Accessibility (recommended reference)
- https://www.a11ywithlindsey.com (blog)
- https://a11yrules.com/ (podcast, 100+ episodes)
- React Podcast #54 w/ Aaron Cannon
- Marcy Sutton's a11y egghead.io course
- A11ycasts YouTube series from Google
- https://reakit.io (accessibility first React components)
- Twitter #a11y
We all have different resources that "stick" with us. Here are some of mine:
WAI-ARIA Authoring Practices 1.1
WCAG
(Web Content Accessibility Guidelines)
1) Use semantic HTML
- Low effort. High impact.
- Highly neglected.
- Saves you time/effort. Gives functionality for free!
- Take some time and give yourself a refresher.
MDN is typically a great reference for anything web related -Me
HTML element reference
https://developer.mozilla.org/en-US/docs/Web/HTML/Element
A11y related guide
https://developer.mozilla.org/en-US/docs/Learn/Accessibility/HTML
<div onClick>
<a href>
- Use when "navigating"
- Should update URL
- Never with empty href
- Support CMD + click
<button onClick>
- Use when "interacting"
- Typically should not update URL
- type="button" vs.
type="submit" (default) - Will clicking affect content on page? Should likely use a button
Recommended reading:
- https://marcysutton.com/links-vs-buttons-in-modern-web-applications
- Many other similar write ups
<details>
The Details disclosure element
<h1>A heading</h1>
<h2>A heading</h2>
<h3>A heading</h3>
<h4>A heading</h4>
<h5>A heading</h5>
<h6>A heading</h6>
<p class="big-and-fancy">
Big typography, but not a heading!
</p>
Low hanging fruit
- Add appropriate alt tags to all images
- Use h1, h2, etc... appropriately
- Add name attributes and labels to all form inputs
- Add lang attribute <html lang="en">
- Never remove focus styling
- Avoid tabindex (really)
*maybe -1 or 0, never > 0
2) Ensure forms are accessible
3) Develop responsibly and reinvent the wheel with care
- Consider a11y when selecting 3rd party libraries
- Consider a11y when building custom components
- Acknowledge that if a11y is not considered up front it very likely will not be "revisited" and improved later
- Leverage browser native elements and behaviors whenever possible
4) Automate and enforce
- Proper abstractions provide baked in a11y
- Enforce with ESLint
- cypress-axe
- Set up reporting on your CI
- Much more...
Reduce friction to baking accessibility in up-front and automate enforcement to nudge more accessible development by default
5) Audit yourself during development
- Keyboard-navigate through features
- Run axe audit (takes seconds)
- Fire up VoiceOver (takes only seconds)
- Push back on inaccessible designs (color, UI)
ARIA
No ARIA is better than bad ARIA
ARIA role is a promise
Adding a role to an element is a promise that you have also incorporated JavaScript that provides the keyboard interactions expected for a button. Unlike HTML input elements, ARIA roles do not cause browsers to provide keyboard behaviors or styling.
Using a role without fulfilling the promise of that role is similar to making a "Place Order" button that abandons an order and empties the shopping cart.
Learn from Lindsey!
Lindsey Kopacz is a frontend developer who specializes in accessibility. She has a pretty great blog! Especially on the topic of ARIA in a way that doesn't make your eyes glaze over.
There are a lot of great resources and accessibility champions out there
- Marcy Sutton
- Jen Luker
- Lindsey Kopacz
- Ryan Florence
- Nic Steenhout
- Many more...
Common Patterns
and Challenges
- Modals
- Custom form elements:
Dropdowns, radio, inputs, etc... - Date Pickers
- Calendars
- Tooltip
- Charts
- More...
Reakit - https://reakit.io/
Resources
- https://a11yproject.com/
- ARIA https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles
- https://w3c.github.io/using-aria/
- WCAG https://www.w3.org/WAI/standards-guidelines/wcag/
- Deque's Accessibility Guideline PDF
- https://marcysutton.com/
- https://www.a11ywithlindsey.com/
- https://webaim.org/
- https://reakit.io/
Discussion!
Web Accessibility
By Erik Aybar
Web Accessibility
- 672