joshblack / awesome-a11y

A collection of resources around web accessibility

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

awesome-a11y

A personal collection of resources, notes, and references for web accessibility

Table of Contents

Links & Resources

Resources

Blogs

Tools

Videos

Talks

Newsletters

Design Systems

Name Homepage Repo
GOV.UK Design System https://design-system.service.gov.uk/ https://github.com/alphagov/govuk-design-system
U.S. Web Design System https://designsystem.digital.gov/ https://github.com/uswds/uswds

Screen Readers

Getting started

Training

JAWS

Command Description Source
Press JAWS Key + Spacebar, then press H View JAWS speech history Link
Press Shift + JAWS Key + F1 Announce accessibility info from DOM Link

Links & Resources

NVDA

  • The Focus Highlight add-on is incredibly useful

Links & Resources

TalkBack

Links & Resources

VoiceOver

Links & Resources

Concepts

This section contains information around different concepts as they relate to web accessibility. These are broader techniques that should be supported or considered when building for the web.

Windows High Contrast Mode

Checklist

  • Enable Windows High Contrast Mode
  • Verify that the piece of UI that you're testing for is visible, including any interactions
  • Make sure to adjust the Windows High Contrast Mode theme to verify that the keywords adapt to user preference

Focus styles

When authoring focus styles, in particular with box-shadow, it's important to note that Windows High Contrast Mode will ignore these changes (Reference). One recommendation from Sarah Higley is to use a transparent outline along with box-shadow (or other custom focus styles). This transparent outline should match the width of your custom focus styles and will be visible when WHCM is turned on.

Links & Resources

Forced Colors Mode

Spec

Forced colors mode is an accessibility feature intended to increase the readability of text through color contrast. Individuals with limited vision often find it more comfortable to read content when there is a particular type of contrast between foreground and background colors.

Source

Techniques

  • forced-colors media query
  • forced-color-adjust CSS property
  • CSS system colors

Links & Resources

Prefers reduced motion

A user may enable a setting on their device to minimize the amount of non-essential motion. This can be detected using the prefers-reduced-motion CSS media feature.

It's important to note that this setting does not necessarily mean that all motion needs to be disabled if reduce is set. Instead, this setting represents a spectrum that indicates if a user experiences distraction or nausea from animated content.

Links & Resources

Speech Recognition

Software that helps to control the device with one's voice

Tools

Tool Operating System Integration
Dragon Naturally Speaking Windows Third-party
Speech Recognition Windows Built-in
Voice Control macOS Built-in
Voice Control iOS Built-in
Voice Access Android Built-in

Interaction Patterns

  • Dictation command
  • Voice command
  • Mouse Grids
  • Show labels or names

Techniques

Links & Resources

Landmarks

Links & Resources

Patterns

This section contains information around ways in which a component, or set of components, may be used and how that pattern may or may not be problematic.

Disclosure

A disclosure is a widget that enables content to be either collapsed (hidden) or expanded (visible).

Source

Links & Resources

Live Regions

Links & Resources

Roving tabindex

Links & Resources

Scrollable regions

Often related to this violation: https://dequeuniversity.com/rules/axe/4.0/scrollable-region-focusable

Links & Resources

Skeletons

Links & Resources

Text Truncation

Links & Resources

Visually Hidden

Links & Resources

Responsive Type

Links & Resources

Attributes

This section contains information around ways in which an attribute may be used on an element in a way that may or may not be problematic.

aria-busy

Links & Resources

aria-disabled vs disabled

Generally, having a UI element be disabled is unhelpful. It does not indicate why the control is in a disabled state. If possible, find a way to communicate why the current state is invalid and how to remedy it.

In situations where you would like to communicate why something is conditionally not available, one may use aria-disabled. It's important that the UI element looks and acts disabled and that there is a clear explanation as to why the control is not available.

The aria-current attribute

Links & Resources

The aria-haspopup attribute

Links & Resources

The title attribute

Usage of the title attribute is problematic as the information is not exposed in an accessible way. From the HTML Spec:

Relying on the title attribute is currently discouraged as many user agents do not expose the attribute in an accessible manner as required by this specification (e.g., requiring a pointing device such as a mouse to cause a tooltip to appear, which excludes keyboard-only users and touch-only users, such as anyone with a modern phone or tablet).

https://html.spec.whatwg.org/multipage/dom.html#the-title-attribute

Links & Resources

The placeholder attribute

Links & Resources

Focus

https://w3c.github.io/aria/#managingfocus

  • Tab order
  • Roving tabindex
  • aria-activedescendant
  • Determining initial focus
    • Sometimes it's helpful to have the "selected" item be the initial focus candidate
    • It's important to remove disabled, hidden, or otherwise unavailable items from initial focus candiates
  • Restoring focus
    • It's important to remember what the last active element was in order to restore focus to it
  • When swapping out or removing a button, make sure to restore focus to a previous item or add it to the item that has replaced the button
    • e.g. a follow button that is swapped out for a unfollow button

Elements

SVG

Generally, the structure of an svg icon should match the following:

<svg aria-hidden="true" focusable="false">
  <!-- ... -->
</svg>
  • aria-hidden is set to "true" to hide the decorative icon
  • focusable is set to "false" to make this element inert in IE11 and Edge

An <svg> element may use an aria-label along with role="img" if used as the contents of a control, like a <button>, where the label should be communicated.

If interactive, the <svg> element must provide a label, tabindex, and use role="img":

<svg aria-label="Icon label" role="img" tabindex="0" focusable="true">
  <!-- ... -->
</svg>

An <svg> element may use aria-labelledby with <title> to provide a label instead of aria-label.

References

Components

This section contains information around specific components and how they might be built accessibly or challenges that one may run into.

Accordion

APG

Links & Resources

Breadcrumb

Links & Resources

Button

Features

  • Variants
    • Primary
    • Secondary
    • Outline / Ghost
  • States
    • Default
    • Focus
    • Active
    • Hover
    • Disabled
  • Content
    • Text-only
    • Icon-only (with tooltip)
    • Text and icon
  • Interesting combinations
    • Disabled button plus tooltip

Links & Resources

Combobox

Links & Resources

DataTable

Features

  • Row expansion
  • Filtering
  • Sorting
    • By single column
    • By multiple columns
  • Selection
    • Keyboard shortcut: Shift+DownArrow to select a row
  • Pagination
  • Inline editing
  • Virtualization
  • Batch actions
  • Inline actions

Links & Resources

Dialog

Behavior

  • When dialog is activated focus is moved to the dialog.
  • Default initial focus is on the first interactive element in the dialog.
  • The dialog should have an accessible name and announce itself as a "dialog".
  • The dialog should be dismissable by
    • activating a "close" button inside the dialog
    • pressing the escape key
    • blurring the dialog by clicking or tapping outside of it
  • If the dialog is modal obscured contents should be inert and inaccessible via keyboard and virtual cursor by constraining focus to the dialog in a "ring".
  • If the dialog is non-modal keyboard and virtual cursor focus is not constrained to the dialog and can leave the dialog causing it to close.
  • When the dialog is closed focus should return to the triggering element unless the dialog is non-modal and was closed by focus or virtual cursor leaving the dialog.

Links & Resources

Link

Links & Resources

Modal Dialog

APG

Links & Resources

Notifications

Links & Resources

Pagination

  • Use a surrounding <nav> with an appropriate aria-label
  • For Previous and Next links:
    • Make sure any direction visuals (like icons for arrows) are hidden (either through aria-hidden="true" or role="presentation")
    • Make sure they use <a> tags
    • Make sure they use rel="prev" and rel="next", respectively
  • For page links:
    • If possible, wrap in a surrounding <ul> or <ol>
    • Each item is within a <li> and uses a <a>
    • Each item should have an aria-label with contents set to the localized text representing: "Page {number}"
    • If the item is the current page, it shoudl set aria-current="page"

Example

<nav aria-label="Pagination">
  <ul>
    <li>
      <a href="..." rel="prev" aria-label="Previous page">Previous</a>
    </li>
    <li>
      <a href="..." aria-label="Page 1">1</a>
    </li>
    <li>
      <a href="..." aria-label="Page 2" aria-current="page">2</a>
    </li>
    <li>
      <a href="..." aria-label="Page 3">3</a>
    </li>
    <li>
      <a href="..." rel="next" aria-label="Next page">Next</a>
    </li>
  </ul>
</nav>

Links & Resources

Switch

Usage

  • A switch may have an immediate effect upon activation (button)
  • A switch may have an effect upon form submission (<input type="checkbox">)

Links & Resources

Tooltip

Links & Resources

Tree View

Scenarios

  • Selection (single, multi)
  • Navigation
  • Leading and trailing visuals and labels
  • Dynamically loading in sub-trees

Discussions

Design Systems

Name Guidelines CSS Web Components React Angular
Carbon Design System Link Link
Clarity Design System Link
Spectrum Link

Abbreviations

Abbrevation Word or phrase
APG Authoring Practices Guide, see Link
ARIA Accessible Rich Interactive Applications, see Link
WAI Web Accessibility Initiative, see Link
WHCM Windows High Contrast Mode

About

A collection of resources around web accessibility

License:MIT License


Languages

Language:JavaScript 100.0%