Skip to content

fix(a11y): restore section landmarks and skip-link focus in built output - #22

Open
ashishbhateja wants to merge 1 commit into
mainfrom
fix/accessibility-landmarks
Open

ashishbhateja wants to merge 1 commit into
mainfrom
fix/accessibility-landmarks

Conversation

@ashishbhateja

Copy link
Copy Markdown
Owner

What this changes

Two small, concrete accessibility fixes affecting the published edition:

  1. ARIA region landmarks in built output — build.mjs's page template was missing aria-labelledby on all four <section> elements. Without an accessible name, a <section> is not exposed as a landmark by browsers; screen readers navigating by landmark (F6 / rotor) would find no named regions in the published edition, even though reader.html (the dev-server version) correctly exposes four: The 2026 arc, Your interests, Search this edition, and Reading list. The fix adds the matching aria-labelledby attributes to each section in the template, and adds the missing id="recommendations-heading" to the Reading list heading.

  2. Skip-link focus — <main id="main"> lacked tabindex="-1" in both reader.html and the build template. Without it, activating the skip link moves the viewport but leaves keyboard focus behind the link in browsers that don't natively focus non-interactive elements (the documented behaviour in WCAG technique SCR28 / WebAIM skip-nav guide). Adding tabindex="-1" makes focus land on <main> without adding a visible ring (:focus-visible is not triggered for programmatic focus).

Why

Closes #5 (partial — landmark and skip-link items from the accessibility checklist).

Checklist

  • node scripts/smoke.mjs passes (19/19)
  • No new runtime dependencies
  • For UI changes: keyboard, focus, and semantics considered
  • No magazine content committed (developed against the sample edition)

Generated by Claude Code

The build.mjs page template was missing aria-labelledby on all four
<section> elements, so the published edition exposed no navigable ARIA
region landmarks — a screen reader sees undifferentiated content
regions where reader.html correctly exposes four named landmarks.

Also adds tabindex="-1" to <main id="main"> in both reader.html and
the build template so the skip-link reliably moves keyboard focus (not
just the viewport) on all current browsers — the standard technique
from WCAG SCR28 / WebAIM.

Advances issue #5 (Accessibility).

This branch has not been deployed

No deployments
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.

Accessibility: Improve readability and navigation for screen readers and users with disabilities

2 participants