Skip to content

fix(a11y): add skip link to main content#3117

Closed
leno23 wants to merge 1 commit into
rust-lang:masterfrom
leno23:fix/skip-to-main-content-2107
Closed

fix(a11y): add skip link to main content#3117
leno23 wants to merge 1 commit into
rust-lang:masterfrom
leno23:fix/skip-to-main-content-2107

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 17, 2026

Summary

  • Add a "Skip to main content" link as the first focusable element in the page
  • Link targets #mdbook-content (with tabindex="-1" for focus on activation)
  • Visually hidden until focused, matching common doc-site patterns (Docusaurus, Starlight)

Motivation

Keyboard users had no way to bypass repeated navigation blocks (sidebar, menu bar), failing WCAG 2.4.1 (#2107).

Test plan

  • cargo test --test testsuite (110 passed)

Fixes #2107

Made with Cursor

Add a visually hidden "Skip to main content" link as the first focusable
control. It targets the existing #mdbook-content landmark so keyboard
users can bypass the sidebar and menu bar (WCAG 2.4.1).

Fixes rust-lang#2107

Co-authored-by: Cursor <cursoragent@cursor.com>
@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label May 17, 2026
@ehuss ehuss closed this May 23, 2026
@rustbot rustbot removed the S-waiting-on-review Status: waiting on a review label May 23, 2026
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.

Output lacks bypass blocks (fails WCAG 2.4.1)

3 participants