Skip to content

a11y: search landmark, article aria-label, touch targets (#5) - #23

Open
ashishbhateja wants to merge 1 commit into
mainfrom
fix/a11y-search-landmark-touch-target
Open

ashishbhateja wants to merge 1 commit into
mainfrom
fix/a11y-search-landmark-touch-target

Conversation

@ashishbhateja

Copy link
Copy Markdown
Owner

What this changes

Three small, targeted WCAG improvements to the reader UI, all in src/reader/:

reader.html — add role="search" to the search <section>.
The section was already labelled via aria-labelledby, making it a generic region landmark. Adding role="search" promotes it to a proper ARIA search landmark, which screen-reader users can jump to directly with their landmark shortcut (e.g. D in NVDA, or the VoiceOver rotor).

reader.js — set the <article> landmark's aria-label to the open article's title.
When an article opens, the static aria-label="Article" was the only label visible to the landmark menu. The label is now set dynamically to the article title (e.g. "The Mother on Equanimity") so screen-reader users see which piece is open without having to navigate into the element. It is reset to "Article" on close.

reader.css — add padding-block: 0.55rem to .link buttons.
.link is the style for every article-title button in the reading list. With the base font (1 rem, 1.65 line-height) the rendered height was ~26 px, well below the WCAG 2.5.5 Touch Target (AA) minimum of 44 px. The added vertical padding raises the tap target to ~44 px.

Why

Closes part of #5 (Accessibility: ARIA landmarks, touch target sizes).

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

Three focused WCAG improvements to the reader:

- reader.html: add role="search" to the search section, making it a
  proper ARIA landmark (screen reader users can jump to it with their
  landmark shortcut rather than finding a generic region).

- reader.js: set aria-label on the <article> landmark to the article
  title when opened, so the landmark menu names the open piece ("The
  Mother on Equanimity" instead of just "Article"). Reset to "Article"
  on close.

- reader.css: add padding-block: 0.55rem to .link buttons. With 1rem
  text and 1.65 line-height the tap height was ~26 px; the padding
  brings it to ~44 px, meeting WCAG 2.5.5 Touch Target (Level AA).

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.

2 participants