WCAG 2.1 AA Compliance
WooCommerce Category Accordion v3 is built to meet WCAG 2.1 Level AA guidelines. This includes:
- Sufficient colour contrast ratios (minimum 4.5:1 for text).
- All interactive elements reachable and operable via keyboard.
- Meaningful ARIA labels and roles.
- No content that flashes more than 3 times per second.
ARIA Attributes
The accordion markup uses the following ARIA attributes to communicate state to assistive technologies:
| Attribute | Element | Purpose |
|---|---|---|
role="tree" |
Root <ul> |
Identifies the list as a navigable tree widget. |
role="treeitem" |
Each <li> |
Marks each category as a tree item. |
aria-expanded="true|false" |
Parent items | Communicates whether child categories are visible. |
aria-controls |
Toggle button | References the child list controlled by this button. |
aria-current="page" |
Active category link | Identifies the current category to screen readers. |
aria-hidden="true" |
SVG icons | Hides decorative icons from the accessibility tree. |
Keyboard Navigation
| Key | Action |
|---|---|
| Tab / Shift+Tab | Move focus to the next/previous interactive element. |
| Enter / Space | Follow a category link or toggle expand/collapse on a parent. |
| ↓ Arrow Down | Move focus to the next visible tree item. |
| ↑ Arrow Up | Move focus to the previous visible tree item. |
| → Arrow Right | Expand a collapsed parent category. |
| ← Arrow Left | Collapse an expanded parent category. |
| Home | Move focus to the first tree item. |
| End | Move focus to the last visible tree item. |
Screen Reader Support
The accordion has been tested with the following screen readers:
- NVDA + Firefox (Windows)
- JAWS + Chrome (Windows)
- VoiceOver + Safari (macOS / iOS)
- TalkBack + Chrome (Android)
RTL (Right-to-Left) Support
When WordPress is configured for an RTL language (Arabic, Hebrew, Urdu, etc.), the accordion layout automatically mirrors — indentation and icons flip to the right side. No extra configuration is needed.