Skip to content

fix(a11y): correct ARIA naming on overlay and progress indicator - #249

Merged
squidfunk merged 1 commit into
zensical:masterfrom
adam-moss:fix/a11y-overlay-progressbar-aria
Oct 1, 2026
Merged

squidfunk merged 1 commit into
zensical:masterfrom
adam-moss:fix/a11y-overlay-progressbar-aria

Conversation

@adam-moss

Copy link
Copy Markdown
Contributor

Summary

Two theme templates render ARIA roles without valid accessible names,
producing WCAG 2.2 violations on every generated page. This fixes both.

Found while auditing a Zensical-built documentation site with Playwright +
axe-core (WCAG 2.2 A/AA). Each issue reproduced on all 250 audited pages.

Changes

aria-prohibited-attr — drawer overlay (src/base.html)

The overlay is <label class="md-overlay" for="__drawer" aria-label="…">.
aria-label is not permitted on an element whose implicit role prohibits
naming, so axe-core reports aria-prohibited-attr. The overlay is a
decorative backdrop that mirrors the drawer toggle; it carries no unique
meaning for assistive technology. Fix: remove the aria-label and add
aria-hidden="true".

aria-progressbar-name — instant-navigation progress (src/partials/progress.html)

<div class="md-progress" role="progressbar"> has no accessible name, so
axe-core reports aria-progressbar-name. role="progressbar" permits
naming, so this adds aria-label from a new translatable string
("progress": "Loading" in en.html), following the existing lang.t()
pattern used by toc.html.

Rebuilt assets

dist/ was rebuilt with npm run build per CONTRIBUTING; the three
dist/ changes correspond exactly to the three src/ edits, with no
unrelated churn.

Testing

  • npm run build completes cleanly.
  • Verified the built dist/base.html and dist/partials/progress.html
    reflect both fixes.

Notes

  • Only the English (en.html) translation gains the new progress key.
    Other language files are unchanged and will fall through to the key name
    until translated.

The drawer overlay used aria-label on a <label> element, but the label's
implicit role prohibits naming, so axe-core flagged aria-prohibited-attr
on every page. The overlay is a decorative click-to-dismiss backdrop that
duplicates the drawer toggle, so it should not be named or exposed. Mark
it aria-hidden and drop the prohibited aria-label.

The instant-navigation progress indicator declared role="progressbar"
with no accessible name, tripping aria-progressbar-name on every page.
Add an aria-label sourced from a new translatable "progress" string so
assistive technology announces the loading state.

Rebuilt dist assets to match, per CONTRIBUTING.

AI-Assisted: true
AI-Provider: Anthropic
AI-Model: claude-sonnet-4-5
AI-Tool: kiro
Signed-off-by: Adam Moss <2951486+adam-moss@users.noreply.github.com>
@squidfunk

Copy link
Copy Markdown
Member

Thanks, LGTM!

@squidfunk
squidfunk merged commit 5e34ab8 into zensical:master Oct 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants