This guide will help you address common accessibility pitfalls in web applications and content websites.
We aim to comply with the Web Content Accessibility Guidelines (WCAG) 2.2, level AA. WCAG has been adopted as the standard for accessibility legislation around the world.
Designing and coding for accessibility helps everyone. People with disabilities or age-related challenges that affect seeing, hearing, moving, speaking, or understanding information need accessible design. But disabilities can also be temporary or situational, like having an injury, being in a noisy place, or dealing with glare.
The Web Content Accessibility Guidelines (WCAG) ensure that interfaces are perceivable, operable, understandable and robust.
Components, styles and documentation for Vanilla are written with accessibility in mind, but do not guarantee an accessible experience for your website or web application.
When you use Vanilla, check the Accessibility tab in each component's documentation. We also suggest that you check the code examples, which follow best practices.
Whether you are using Vanilla or not, make sure to use correct HTML markup and semantics to make the most of browsers' built-in accessibility features.
Automated tools can identify many issues with markup and styles. However, they are not sufficient for conducting a comprehensive accessibility audit. Use them mindfully, and do rely as well on manual reviews.
Here are some tools that may help you:
These checks support people with low vision (cataracts), color vision deficiencies (color blindness), photosensitivity, or reading difficulties by ensuring clear contrast, readable text at any size, no reliance on color alone, and safe, non-distracting visuals.
prefers-reduced-motion to honour system settings.Default styles from Vanilla already provide sufficient contrast out of the box, but you should double check elements have enough color contrast so all content is perceivable:
No minimum contrast is required for inactive components, decorative images or graphics, or logos.
You should be particularly cautious in the following cases:
For checking color contrast:
Be mindful of text on images, and the use of transparency: some automatic tests may evaluate contrast incorrectly in those cases. Common sense may help flag up problems too: if text looks unreadable to you, it's not accessible no matter what the contrast checker says.
These checks ensure a good experience for keyboard-only users, including people with motor disabilities that cannot use a mouse or trackpad, blind users who rely on screen readers, and power users who just prefer to use their keyboard.
For a simple test, select the window you want to test. Then hit the Tab key repeatedly and check how focus moves through all interactive elements.
For a more thorough test, you need these shortcuts:
| Action | Shortcut |
|---|---|
| Move to next interactive item | Tab |
| Move to previous interactive item | Shift+Tab |
| Interact with an item or group | Enter |
| Exit a group | Esc |
All graphical interfaces should be readable with common screen readers. Screen readers benefit blind and visually impaired users who rely on audio feedback to navigate interfaces. To work properly, screen readers require good markup, labelling, and logical content structure.
Orca is the default screen reader in Ubuntu Desktop and other Linux distributions. It can be enabled in Settings > Accessibility > Seeing. You can also enable Screen Reader in the Accessibility menu.
Note that some Orca features don't work with certain combinations of Ubuntu releases and application toolkits. Read Improve screen reader usability.
You need to become familiar with keyboard shortcuts to use the screen reader. Modifier keys are used in the shortcuts:
orca -s in the terminal.| Action | Laptop layout | Desktop layout |
|---|---|---|
| Enable screen reader | Super+Alt+S | Super+Alt+S |
| Quit screen reader | Super+Alt+S | Super+Alt+S |
| Learn mode | Orca+H (exit with Esc) | Insert+H (exit with Esc) |
| Orca preferences | CapsLock+Space | Insert+Space |
| Toggle [flat review](https://documentation.ubuntu.com/desktop/en/latest/how-to/accessibility/orca/navigate-the-screen-using-the-screen-reader/#examine-a-window) | CapsLock+P | Insert+- on the numeric keypad |
| Say all (in flat review) | CapsLock and double-press ; | Double-press + on the numeric keypad |
| Read current line | CapsLock+I | 8 on the numeric keypad |
| Read next line | CapsLock+O | 9 on the numeric keypad |
| Read previous line | CapsLock+U | 7 on the numeric keypad |
You can find further guidance in the screen reader documentation.
For testing on Windows, we recommend NVDA (NonVisual Desktop Access), a free, open-source screen reader. Once installed, you can start it via the desktop shortcut or by pressing Ctrl + Alt + N.
You need to become familiar with keyboard shortcuts to use the screen reader. By default, the NVDA key is mapped to the Insert key (Desktop) or Caps Lock (Laptop), depending on how you configured it during setup.
NVDA uses "Browse Mode" (for reading web pages) and "Focus Mode" (for typing in forms). It usually switches automatically, but knowing this distinction is vital for testing.
| Action | Shortcut |
|---|---|
| Turn NVDA on | Ctrl + Alt + N |
| Turn NVDA off | NVDA + Q |
| Input Help (Learn mode) | NVDA + 1 (Press again to exit) |
| NVDA Menu (Preferences) | NVDA + N |
| Read all (from current position) | NVDA + Down Arrow |
| Read current line | NVDA + Up Arrow |
| Read next line | Down Arrow |
| Read previous line | Up Arrow |
| Pause Speech | Control |
VoiceOver is the default screen reader in macOS. Go to System Settings > Accessibility > VoiceOver to toggle it on. You can also quickly toggle it using the shortcut Command + F5 (or Command + Triple-press Touch ID on laptops with Touch ID).
You need to become familiar with keyboard shortcuts to use the screen reader. The VO key is the modifier key used for almost all commands. It is mapped to Control + Option pressed together. You can also configure Caps Lock to act as the VO key in settings.
VoiceOver has a feature called "Quick nav" (toggle with Left Arrow + Right Arrow) that allows you to navigate using single arrow keys without holding the VO keys.
| Action | Shortcut |
|---|---|
| Turn VoiceOver on | Command + F5 |
| Turn VoiceOver off | Command + F5 |
| Keyboard Help (Learn mode) | VO + K (Press Esc to exit) |
| VoiceOver Utility (Preferences) | VO + F8 |
| Read all (from current position) | VO + A |
| Read current item/line | VO + F3 (Description) |
| Move to next item | VO + Right Arrow |
| Move to previous item | VO + Left Arrow |
| Interact with group/web area | VO + Shift + Down Arrow |
| Stop Interacting (Exit group) | VO + Shift + Up Arrow |
| Pause Speech | Control |
.u-off-screen) to make a label readable only for screen reader.lang attribute on the root element (e.g., <html lang="en">)<header>, <nav>, <main>, <article>, <aside>, <footer>) and ARIA landmarks are used to define page regions<h2 class="p-heading--3">:before, :after) as they are not accessible to screen readersaria-hidden="true" or appropriate CSS techniques<title> and <desc> elements, or use aria-label or aria-labelledbyBesides the more common checks above, you should also keep in mind these:
When auditing an app, check any outstanding accessibility issues in the app repository. Actual users are the best source for accessibility issues.
You should proactively test your interface with a diverse group of users, including people who use assistive technologies. You can recruit testers through specialized agencies or by reaching out to colleagues and friends.
If you spot an accessibility problem in Vanilla, let us know by filing an issue on GitHub.
If you found an accessibility issue in another project, please file an issue in the relevant repository.
Describe the issue in as much detail as you can, and provide instructions to test it. Screenshots and screen recordings also help. You can propose a fix for the issue, but it's not strictly necessary.
The volume of information on the WCAG website can be disorienting. We keep the following links handy for quick reference:
The web is abundant in tools that help to create and test for accessible sites. We find the following particularly useful: