Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(1-3295): fix broken skip link #9239

Merged
merged 3 commits into from
Feb 6, 2025
Merged

Conversation

thomasheartman
Copy link
Contributor

@thomasheartman thomasheartman commented Feb 6, 2025

Fixes the issue where the skip link wouldn't take you to the main content of the page anymore.

Also includes a few related minor semantic and a11y improvements:

  1. The main element now only surrounds the actual main content of the page. The sidebar is nav content and shouldn't be within it. The easiest way to do this was to change the element that was previously a main to a div and make the main content wrapper a main instead.
  2. Makes the skip link target visible when focused. But invisible otherwise. This has two benefits:
    1. It's immediately obvious that using the skip link has worked. It tells you that it's at the start of the main content.
    2. Because the link now has text, it can be targeted by link search (e.g. in Firefox, press ' to search for links (I use this a lot)), making it super easy to move your focus to the main content directly. (Yes, landmark navigation should also work here, though, especially with the main change).

The implementation of UI considerations of the skip link are based on the CSS-tricks article a deep dive on skipping to content from 2021.

Here's what it looks like when you skip to content:
image

When it doesn't have focus, it's invisible.

Copy link

vercel bot commented Feb 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-docs ❌ Failed (Inspect) Feb 6, 2025 9:14am
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 6, 2025 9:14am

Copy link
Contributor

github-actions bot commented Feb 6, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

Copy link
Member

@nunogois nunogois left a comment

Choose a reason for hiding this comment

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

LGTM

@thomasheartman thomasheartman merged commit 2ff385a into main Feb 6, 2025
7 of 12 checks passed
@thomasheartman thomasheartman deleted the fix(1-3295)/broken-skip-link branch February 6, 2025 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants