Skip to content

a11y: add skip to main content navigation link (WCAG 2.4.1) - #8639

Open
mdimamhosen wants to merge 1 commit into
reactjs:mainfrom
mdimamhosen:feat/a11y-skip-to-main-content
Open

a11y: add skip to main content navigation link (WCAG 2.4.1)#8639
mdimamhosen wants to merge 1 commit into
reactjs:mainfrom
mdimamhosen:feat/a11y-skip-to-main-content

Conversation

@mdimamhosen

Copy link
Copy Markdown

Description

This PR implements a "Skip to main content" link to satisfy WCAG 2.4.1 (Bypass Blocks, Level A).

Currently, keyboard and assistive technology users navigating react.dev must tab through all header links, search, and sidebar navigation items on every page before reaching the main article.

Changes:

  • Added an accessible skip link at the top of Page.tsx using sr-only focus:not-sr-only, styled with the site's design tokens. When focused via keyboard Tab, the skip button appears at the top-left corner.
  • Added id="main-content" to the <main> landmark element in Page.tsx.

Verification

  • yarn tsc passed (0 errors)
  • yarn prettier:diff passed
  • npx next lint passed
  • yarn test:eslint-local-rules passed

Copilot AI lite review requested due to automatic review settings September 4, 2026 20:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Size changes

Details

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 115.36 KB (🟡 +214 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Five Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/404 127.67 KB (🟡 +110 B) 243.03 KB
/500 127.68 KB (🟡 +110 B) 243.04 KB
/[[...markdownPath]] 130.13 KB (🟡 +110 B) 245.49 KB
/errors 127.92 KB (🟡 +110 B) 243.28 KB
/errors/[errorCode] 127.9 KB (🟡 +110 B) 243.26 KB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 10% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

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