Getting a sense of how accessible your module, theme or site is can seem like an overwhelming task. If you are new to accessibility, the sheer breadth of the topic can leave you wondering where to start. Accommodating a diverse range of abilities means there is a correspondingly diverse range of issues to consider. On this documentation, we have listed necessary considerations into a logical, step by step process for reviewing the accessibility of your module theme or site. Remember that just like every other bug, a developer usually needs to be able to replicate it to be able to fix it. 

Start by running automated tooling

Many accessibility problems can be caught by running the page through automated tools. Some of the automated tools include WAVE, Accessibility Insights, Google Lighthouse,  Siteimprove and of course Editoria11y. Some of this can be automated by using axe-core. These tools will help you quickly catch some accessibility issues, such as the incorrect structure of the markup, missing ARIA attributes and insufficient color contrast.

Using live previews for manual accessibility testing

When live previews (powered by Tugboat) are enabled for a project, contributors reviewing any issue with an open merge request can access a link to an automatically built preview of a Drupal site with the MR changes applied and the appropriate modules installed. Live previews can reduce the time required for manual accessibility reviews for contributors, since they won't need to set up a local environment. Core, Drupal CMS, and many contributed projects already have live previews enabled. You can add Tugboat-powered live previews to any Drupal contributed project by opening an issue in the project and following the steps in Using Tugboat previews on Drupal Core and contrib merge requests.

Test Keyboard Navigation

Keyboard navigation is the primary means of reaching everything on screen for users who either cannot or choose not to use a mouse. This includes screen reader users, as well as those with motor impairments such as Repetitive Stress Injury (RSI) or paralysis. For a good keyboarding experience, aim to have a logical tab order and easily discernible focus styles. You should also make sure that the user doesn’t have to navigate through an excessive number of tab stops.

What to look for

Test your responsive breakpoints

After you’ve done all those keyboard tests: Increase your browser zoom until you hit a responsive breakpoint and do it all again. Anyone who is using a high level of browser zoom will be interacting with your “tablet” or “phone” version on their laptop. Mobile breakpoints aren’t just for touchscreen users.

Screen Magnification

Low vision users often need to magnify the content in order to see it. It is a best practice to allow users to magnify content by 200%. You may have already done some zoom testing when evaluating if a site's responsive breakpoints allow keyboard focus. On a desktop/laptop users can increase or decrease the size of their content by pressing the Control Key and "+" or the Control Key and "-". Browsers usually display the zoom size and allow you to quickly git to a 200% (2X) magnification. Many low vision users will use much higher magnifitions, and it is a better practice to check that a site is still functional with a 400% (4X) magnification.

Aside from the built-in magnification tools, there are tools like ZoomText can support some low vision users. It is also worth noting that some users with disabilities may use a combination of screen magnification and screen readers in order to navigate your site. 

Headings

Headings are the framework of your content. A good heading structure reflects the content on your page, like the index of a book. Having descriptive headings and meaningful levels is important because some screen reader users use them for skimming the contents of the page.

If you have already run one of the automated accessibility tools, you’ve most likely covered most of the issues related to headings.

What to look for

Color and contrast

There must be sufficient color contrast

Color contrast is the ratio of the foreground color (text) and the background color. Text should have a ratio of 4.5:1 or greater with the background. You can use a color contrast checker to determine whether your colors comply with this requirement.

Color must not be the only means of displaying visual information

Although color is a valid means of displaying visual information, it can’t be the only way that information is conveyed. People with color blindness can experience difficulty when color alone is used to convey important information (and they may miss it entirely).

If using color to convey information, use at least one of the following extra methods too:

Another example is marking required fields with red. Some users may not be able to distinguish red from other colors and would lack information to fill out this form. This can be addressed by adding an asterisk to the field label.

Focus states should not rely on color alone. An additional shape is necessary to convey focus. Typically this would be an extra outline surrounding the interactive control which has focus.

Not by icon alone

If an icon represents an essential part of functionality, it should be accompanied by text that describes its purpose. Make sure interactive elements such as navigation menus are labelled. Not every user understands the icons that are obvious to you. A label is also needed for screen readers to be able to read out the element.

Sound and Video

If the page relies upon sound or video to convey information, ensure that captions or a transcript is available. More information on WebAim article about captions, transcripts, and audio descriptions

This falls under Time-based Media, Guideline 1.2 of WCAG.

Animations and Autoplay video and audio

Animations, videos and/or Audio that automatically plays without control of the user can be distracting to other parts of the page. Even if the animations or videos are in a position of the page that you might not think will cause an issue, we are agnostic to how users are viewing the page.

Examples of Animations, Autoplay video and audio:

To reduce the amount of distractions on the page:

Dynamically changing content

JavaScript makes it possible to dynamically change parts of a page without fully reloading it. Users who cannot fully see these changes still need to be aware they’ve occurred. Examples of dynamic changes to a page are updating a list of search results on the fly or displaying a discrete notification which does not require user interaction. Drupal.announce() API provides a way to announce dynamic content changes on some assistive technologies.

Drupal.announce() is an API built on top of ARIA live regions. Some example use cases for this can be found in this documentation about ARIA live region roles.

The best way to test dynamically changing content is to use a screen reader.

Testing with a screen reader

Running automatic accessibility checks and manually tabbing through the page already goes a long way. If you are not familiar with using a screen reader, many of these issues can be detected without actually using a screen reader.

What to look for

Manual testing with a screen reader

Some issues can only be caught by manually testing the application with a screen reader. The most common screen readers are VoiceOver (Mac OS) and NVDA (Windows). To get started with VoiceOver you can watch a video on VoiceOver basics and read WebAIM tutorial for VoiceOver. To get started with NVDA you can watch a video on NVDA basics and read about how to use NVDA to test your web pages by Deque. It is also worth watching the overview of how screen readers work by Léonie Watson for Smashing Magazine. 

Once you become familiar with the screen reader and have learned the general keyboard commands you need, try turning off your monitor and putting away your mouse. Remember that screen reader pronunciation should be left outside of the scope of testing.

If you are not already a screen reader user, testing with one is not as easy as it may sound. It takes time and diligence to unlearn visual navigation, and to learn the shortcuts and techniques available to a screen reader user. Additionally, all screen readers work a little differently, and it is important to test on as many as you can, as well as to test with different browsers and platforms.