Skip to content

Add a skip link to every explainer page - #1184

Merged
yakew7 merged 1 commit into
yakew7:mainfrom
minutechreview:fix/explainer-skip-link-1170
Oct 25, 2026
Merged

yakew7 merged 1 commit into
yakew7:mainfrom
minutechreview:fix/explainer-skip-link-1170

Conversation

@minutechreview

Copy link
Copy Markdown
Contributor

Summary

Every generated explainer page now starts with a "Skip to content" link, so keyboard users can jump past the top bar (WCAG 2.4.1).

Type

  • Audit
  • Explainer
  • Bug fix
  • Other

Details

  • scripts/build_explainers.py: the page template puts <a class="skip-link" href="#explainer-start">Skip to content</a> first in <body>. The target is the hero section (id="explainer-start" tabindex="-1"), not <main>: on these pages <main> also wraps the top bar, so a link to it would land back before the links it is meant to skip.
  • I used explainer-start rather than content because heading ids are generated from heading text and a heading named "Content" would collide.
  • assets/explainers.css: the same visually hidden .skip-link / .skip-link:focus styles as index.html, and no outline on the hero when it takes focus from the link.
  • Regenerated all 114 pages. The only change in each is the link and the hero attributes. As in Give explainer table header cells scope="col" #1183, I left out the unrelated lastmod bump on decision-curve-analysis-by-group.
  • New test test_every_page_starts_with_a_skip_link_to_the_content builds the fixture site and checks that the first focusable element is the skip link and that its target exists. It fails without the change.

Checks: tests/test_build_explainers.py 26 passed, ruff check, check_em_dash.py and check_generated_files_current.py pass. grep -L skip-link explainers/*.html | wc -l prints 0.

Linked issue

Closes #1170

Signed-off-by: minutechreview <141821420+minutechreview@users.noreply.github.com>
@vercel

vercel Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

@minutechreview is attempting to deploy a commit to the yashkewlani2020-gmailcom's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown

@yakew7 @Shreyash0712 @ahmdkaml @propcgamer20-png - new PR touching a path you own, please review.

@yakew7
yakew7 merged commit 8f6e602 into yakew7:main Oct 25, 2026
19 of 20 checks 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.

Explainer pages have no skip link

2 participants