Skip to content

Instantly share code, notes, and snippets.

@dgowrie
Last active December 18, 2018 18:30
Show Gist options
  • Select an option

  • Save dgowrie/8a7b122b85885c0ebb7ee7270ab52503 to your computer and use it in GitHub Desktop.

Select an option

Save dgowrie/8a7b122b85885c0ebb7ee7270ab52503 to your computer and use it in GitHub Desktop.
Accessibility tips and tools

General Web Accessibility tips and tools

HTML Semantics

Good HTML semantics makes for good accessibility. This means using links, buttons, form elements, and labels appropriately, including:

  • <label> element for form controls with appropriate for / htmlFor (React) and id pairings
  • <fieldset> for groups of related inputs
  • <button> elements for UI controls

More info on semantic HTML as basis for accessibility on this MDN article: https://developer.mozilla.org/en-US/docs/Learn/Accessibility/HTML

Keyboard Focus Management

Tabbing through to focusable UI controls happens natively with appropriate semantic markup.

Applying explicit tabindex / tabIndex (React) settings on non-standard UI elements will sometimes be all extra nudge needed.

"Keyboard traps" like navigation, as well as UI widgets that fall a bit out of the standard convention may require more dynamic, explicit focus management. You may find the following resources helpful:

WAI-ARIA

WAI-ARIA is a technology for adding further semantics that browsers and assistive technologies can recognize. It is particularly helpful with dynamic content and advanced, non-standard UI controls and widgets that involve unsemantic HTML.

Resources for more info:

Testing

Linting in React apps is our first defense! Automated accessibility testing is also integral (and we need to do more of it).

But there are some issues that require manual testing. To get a truly comprehensive testing process, bite the bullet and experience the page with:

  • A screen reader
  • Speakers and microphone off
  • No mouse, navigating with keyboard only

Some resources on manual testing guidelines and checklists:

Browser tools:

Resources

--

todo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment