Add skip navigation link for keyboard and screen reader users - #56
Open
claude[bot] wants to merge 1 commit into
Open
Add skip navigation link for keyboard and screen reader users#56claude[bot] wants to merge 1 commit into
claude[bot] wants to merge 1 commit into
Conversation
Adds a visually-hidden skip link as the first focusable element on the page, targeting #main-content on the container div. Satisfies WCAG 2.4.1 Bypass Blocks, Level A. Fixes #48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #48
What changed
Three additions to
demo/index.html:.skip-link(hidden off-screen) and.skip-link:focus(slides into view attop: 0) rules added in the<head>style block.<a href="#main-content" class="skip-link">Skip to main content</a>added as the very first element inside<body>.id="main-content"added to the existing.containerdiv so the skip link has a valid target.Why
Without a bypass mechanism, keyboard users must Tab through all five navigation links on every page load before reaching the main content. This violated WCAG 2.4.1 Bypass Blocks, Level A. The skip link is invisible during normal mouse use and appears only when a keyboard user focuses it with Tab.
How to verify
Open
demo/index.htmlin a browser, press Tab as the first action — a green "Skip to main content" label should appear at the top-left of the page. Pressing Enter jumps focus to the main container, skipping the nav links.