Accessibility
Every Chameleon component targets WCAG 2.2 AA, and works in Chromium, Firefox, and Safari. This page says what that covers, what is left to your app, where Chameleon still falls short, and how to tell us when it gets something wrong.
What every component does
- WCAG 2.2 AA is the target for every component: contrast, target size, focus appearance, and the rest.
- Keyboard-complete. Every interactive control works without a mouse, and focus is always visible, in a focus ring that takes the theme's colors.
- Standard patterns. Components follow the WAI-ARIA Authoring Practices for what they are, so a menu, a tab set or a slider behaves as screen-reader users expect.
- Touch targets. Buttons, chips, checkboxes, radios, switches, sliders, dials, and list items keep a touch target of at least 48 by 48 pixels by default.
touchTargetsets how far it reaches past the visible control. - Reduced motion. Animations follow the user's reduced-motion setting.
- Forced colors. Components stay usable in Windows high-contrast mode, drawn in the system colors the user chose.
- Right-to-left. Layout, icons, and keyboard direction follow the page's text direction.
How it's tested
Every component is tested with keyboard and pointer, and for what it exposes to assistive technology, in Chromium, Firefox, and Safari. Automated axe-core checks cover the components in Chromium.
Automated checks catch a share of problems, not all of them. Components are also tested by hand with screen readers.
Testing Chameleon with axe
Popovers, tooltips, menus, dialogs, and modal sheets open in the browser's top layer, through the Popover API and a modal <dialog>, which keeps them above everything else on the page. axe-core has two blind spots there, in every browser. We've seen both with every version we test: the axe-core that the component test suites run through @axe-core/playwright, and axe-core 4.14.0 in a standalone reproduction. Neither is a contrast failure: axe reports each as "incomplete", meaning it couldn't measure, and each happens with plain HTML too.
- Text in an open surface is reported as overlapped. axe doesn't model the top layer, so page content under an open surface that is positioned with a z-index, or comes later in the document, ranks above the surface. The user sees the surface on top, and its text on the surface's own color.
- Text set tighter than its glyphs is reported as partially obscured. axe measures text by its glyph boxes, so when an element's line box is shorter than its glyphs, as at
line-height: 1, the glyphs reach past the element. The user sees the whole text, on its own background.
Chameleon's tests leave neither unexplained. For each such result they ask the browser what is on top, at points across every line of the text, with document.elementsFromPoint(), which follows the top layer. Where the text's own element is on top, they measure its color against its background and fail anything under 4.5:1, or 3:1 for large text. Where anything else is on top, they fail it as a real overlap.
When you scan your own app, treat these two results as not yet measured rather than as passes, and check them the same way or with a color-sampling tool.
What your app is responsible for
A component can only be as accessible as the page around it.
- Name what has no visible label. An icon button, a dial, or a search field without a visible label needs an accessible name, set with
aria-label. - Keep the heading outline. Choose heading levels for the document's structure and type styles for their look; Type theming explains why they're separate.
- Check contrast after overriding colors. A generated theme pairs every color with text that clears contrast on it. A color you set by hand is outside that guarantee, so check it.
- Announce what changes. When your app updates content the user didn't act on, tell assistive technology, for example with a live region or a toast.
Where Chameleon falls short
Follow known gaps, and report new ones, in the issue tracker.
Conformance reports
If your procurement process needs an Accessibility Conformance Report, talk to us.
Report a problem
Accessibility is never finished. When we get something wrong, tell us: name the component, the browser, and the assistive technology, and say what you expected to happen.
Related
- Why Chameleon: locale, server data, input pacing and support
- Security: running Chameleon under a strict Content-Security-Policy
- Type theming: the type scale and its roles
- Color theming: color roles and how they pair