Web Accessibility -
Myths and Methods�
Lyle Reed
@lanreed
Web Developer - Lewis Communications�Nodevember 2017 - Nov 27, 2017
What is Accessibility?
UX focused on making a site usable for the widest possible audience.
Quick Myths about Accessibility
MYTH #1: Accessibility is only for the disabled
Users may be "impaired" only in a range of contexts, situations, or periods in their lives.
Myth #2: Screen Readers don’t use JS
?
👍
Myth #3: No other benefits
SEO
Traffic
Reputation
Usability
Types of Impairment
Visual
Auditory
Motor
Cognitive
285 Million
Estimated people worldwide with visual impairment.
Red-green Impairment: 8% males, 0.5% females worldwide
Example of Red-reduced impairment
What other motivations do we have?
American’s with Disabilities Act
�(ADA)��
“a place of public accommodation.”
Courts differ in interpretation, but sales and commercial establishments are explicitly listed.
Web Content Accessibility Guidelines (WCAG) 2.0
DOJ has placed web accessibility, medical equipment, and furniture rulemakings under Title II and III of the ADA on Inactive List. - July 2017
How can I build for impaired users?
Quick Look Best Practices*
*Not all, but some good ones.
Contrast between text and its background color.
Don't indicate important information using color alone
Pair color values to increase contrast
Accessible forms with labels and errors
Be careful overlaying text on images
Accessibility for developers
Use semantic HTML�
HTML is accessible by design.
Limit div soup, strip unnecessary HTML elements
Use header nav section article aside when appropriate
Use headings h1 - h6 for content structure
HTML Landmarks�
These landmarks help define specific areas that a user might want to seek out and can save them a lot of time.
<header> for role="banner"
<main> for role="main"
<nav> for role="navigation"
<footer> for role="contentinfo"
<aside> for role="complementary"
Don’t forget the language attributes
<html lang="en">
Don’t remove focus state styles
NEVER remove focus states from elements
*:focus {� outline: none; //BAD BAD BAD BAD�}
DON’T disable Links
Just don’t do it. A disabled link is not a link, it's just text.
If you MUST, remove the href entirely
Buttons vs Links
Linking to something outside the page? Use an anchor tag.
<a href=”http://www.google.com”>Link to a great website</a>�
Performing an action on the page? Use a button.
<button type=”button”>Submit the thing</button>�
Space selects links, Enter submits buttons.
Make links descriptive�
Assistive technology often finds links on a page and will present them in various forms, instead of using a generic “click here” try to use something more descriptive like a “click here to read more about [Company] Media”
This is also helpful for SEO!
Write good alt text for your images
<img alt=“description of image” src=“/foo.jpg”>
If the image is only for visual purposes and should be ignored by screen readers, use the aria-hidden attribute AND presentation role
<img aria-hidden=“true” role=“presentation” alt=“” src=“/foo.jpg”>
Support keyboard navigation�
Users should be able to tab through the entire page
Avoid allow “keyboard traps”
This happens a lot with modals — make sure there is always a way to exit via keyboard navigation
Caption Rich-Media
Add captions and subtitles to rich-media elements like gifs, videos, and SVGs.
This helps SEO too!
Wow, this sounds like a lot.�How do I test it?�
General Testing
Navigate the page with your keyboard
Make a11y part of QA.
Add accessibility to your project checklist just as you would any other function or feature.
Test early and often
Tota11y bookmarklet
http://khan.github.io/tota11y/
Simple bookmarklet that you can use to run through pages as you build them. It gives you suggestions on how to fix a11y issues.
ChromeVOX - Screen Reader Emulator
Browser only screen reader extension for Chrome
NPM a11y
https://www.npmjs.com/package/a11y
Easy accessibility audits powered by the Chrome Accessibility Tools
Color Contrast Analyzer / Color Oracle
Checks for color contrast
Can use while you are designing in Photoshop, Illustrator, Sketch, whatever
Accessibility is everyone’s responsibility�
More Tools!
More Resources and Slides
http://lylereed.com/node17�
Thank You!