Simple approaches to #a11y

Estella González Madison

Software Engineer

@chicagoing

… with sprinkles of hip-hop quotes

Accessibility is not a feature

Let's Push Things Forward
It's a tall order, but we're taller
- The Streets

My first aha moment

You know it's funny,
when it rains it pours.
They got money for wars,
but can't feed the poor.
-2pac

My second…

On the New York transit line,
If my train goes off the track,
Pick it up!
Pick it up!
Pick it up!
-Tribe Called Quest

Who do we target for web accessibility?

visually impaired
hearing impaired
motor disabilities
cognitive disabilities

Errrbody

users with JS disabled
mobile users

The basics

Main content

Use semantic HTML

<main role="main" id="main-content"></main>

Add "skip to main content" links

http://webaim.org/techniques/skipnav/

DIVs and SPANs are not buttons

DIVs/SPANs are not keyboard focusable

• If it navigates, it is a link
• If it triggers an action, it is a button
• Use CSS to customize BUTTONs

 

http://www.karlgroves.com/2013/05/14/links-are-not-buttons-neither-are-divs-and-spans/

Use the language attribute

 <html lang="en">

enables screen readers to read out the text with correct pronunciation

Don't use placeholders as labels

Bad

Good

https://codepen.io/chicagoing/pen/XMXVvE

Accessible names for HTML elements

My name is… (what?)  My name is… (who?)

The accessible name is used by Assistive Technologies  to identify the element.

 

It can be derived from the element’s content, an attribute, or from an associated element.

https://www.paciellogroup.com/blog/2017/04/what-is-an-accessible-name/

Using the element's content

The content of an <a> element gives the link its accessible name
 

<a href="kid-kudi.html">By Design</a>

Using an attribute

The alt attribute of the <img> element is the accessible name

<img src="img.png" alt="Scott Ramon Seguro Mescudi">
<a href="kid-kudi.html"><img src="img.png" alt="Scott Ramon Seguro Mescudi">artist and actor</a>

When a link contains both an image and text, the two combine to form the link’s accessible name:

Using an associated element

A form element can derive its accessible name from an associated element

<input type="search" id="search-box">
<label for="search-box">Search</label>

Using ARIA

An element's accessible name can be derived from its ARIA label. ARIA overrides all.

<button aria-label="Favorite"></button>

aria-label

<input type="search" aria-labelledby="btn">
<button type="submit" id="btn">Search</button>

aria-labelledby

ARIA roles

WAI-ARIA

Web Accessibility Initiative
Accessible Rich Internet Applications


A set of roles, states, and properties to convey user interface behaviors and structural information

role="search"

No requirements, but a useful property is:

aria-label

an invisible label that is readable by screen readers only

 

example

role="dialog"

Requirements:

• At least one focusable element (close button, input field)
• Focus on a default element when the dialog appears
• Tab order should be contained by the dialog

— MDN, Using the dialog role

aria-describedby / aria-labelledby

role="navigation"

No requirements, but usually used with:

aria-controls
aria-owns
aria-haspopup
aria-expanded

role="form"

Only one requirement

aria-describedby

a visible label for the form

aria-required
aria-invalid
aria-hidden

… and used with these for validation:

Resources

Tools

• ember-template-lint
• react-a11y
• protractor-accessibility-plugin

WAVE: web accessibility evaluation
Accessibility Developer Tools: audit from Chrome Dev Tools

Testing

Learning

Section 508

section508.gov

A11ycasts with Rob Dodson

youtube.com

Checklists & styleguides

The A11Y Project Web Accessibility Checklist

a11yproject.com/checklist.html

Follow

#a11y

A11yNYC Meetup on YouTube

@cariefisher

@rob_dodson

@noopkate (Suz Hinton)

@karlgroves

Screenreaders

Cool cliques throw bricks but seldom hit targets
-The Fugees

My Umi said shine your light on the world
Shine your light for the world to see

- Mos Def

Thank you

Cognizant: Simple approaches to a11y

By Estella Gonzalez Madison

Cognizant: Simple approaches to a11y

  • 1,066