We currently have a couple of open patches that are concerned with improving the example markup for the no-JS version of the Tabs component.
This has immediate practical importance because we are using CSS-only Codex tabs in the (still WIP) migration of the MediaSearch feature (see T336821).
A couple of questions have come up so far, and it is probably better to discuss them here rather than in Gerrit on a specific patch.
- What element in the Tabs markup should receive role="tab"? Should this go on the <li> item in the list of tabs inside the header area, or should it go on an inner element like <label>?
- Is <label> an appropriate target or do we need to re-work the CSS-only markup to use <button> elements? (The JS version uses anchor tags instead).
- Do we need to apply role="presentation" to any of the markup in the tabs header?
- Anything else we need to do that we are not already doing in our example in the docs site?
References
- Codex Tabs Component documentation: https://doc.wikimedia.org/codex/main/components/demos/tabs.html#css-only-version
- MDN docs on ARIA: tab role
Testing Plan
We want to proceed with an empirical test of how the different approaches to markup and ARIA attributes actually inform a real-world screen reader. I suggest using ChromeVox, which is available as a Chrome browser extension and is pretty easy to set up.
- Create a patch for each different approach to markup that we're considering. Patches should reference this task. Each patch should use the existing Codex developer sandbox area to set up a mostly-blank page that only contains a Tabs component with a small amount of content (we want to reduce extraneous noise from the test).
- Once patches are posted, Netlify will build a version of the sandbox page for each patch which we can use for live testing. Developers or testers can then point their screen reader-enabled browser at the demo to see how it performs. Post a summary of the results here in a comment. If feasible, include an audio or video recording of the test.
- None of these patches will ever get merged; once we've decided on the best approach, they can be abandoned (and a new task / new patch can be created to actually change the way Codex Tab components work in both CSS and JS).
Acceptance criteria
- Developers reach consensus on the best way to make Tabs markup accessible
- Codex Tabs docs page is updated to reflect this