Skip to content

fix: improve underlining in "On this page" #1312

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

zqianem
Copy link

@zqianem zqianem commented Apr 18, 2025

This ensures that the anchor that is clicked is always the one that gets underlined, even if just scrolling to that heading would underline a different anchor.

A good test page for this https://svelte.dev/docs/kit/introduction; set the browser window size to 1200x1200 and try to click on "What is SvelteKit" in the right sidebar.

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time.
  • Prefix your PR title with feat:, fix:, chore:, or docs:.
  • This message body should clearly illustrate what problems it solves.

zqianem added 2 commits April 17, 2025 23:06
This ensures that the anchor that is clicked is always the one that gets
underlined, even if just scrolling to that heading would underline a
different anchor.

Using `onhashchange` alone instead of adding `onclick`s to each anchor
is not sufficient because it's possible to click on an anchor that
already has its hash in the URL but has been scrolled away from.
Copy link

vercel bot commented Apr 18, 2025

@zqianem is attempting to deploy a commit to the Svelte Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Apr 20, 2025

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

Name Status Preview Updated (UTC)
svelte-dev ✅ Ready (Inspect) Visit Preview Apr 20, 2025 2:54pm

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.

1 participant