-
-
Notifications
You must be signed in to change notification settings - Fork 451
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
Use scroll-behavior: smooth
for anchor links
#2091
Conversation
🦋 Changeset detectedLatest commit: 9ad93fb The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…when switching tabs
Thanks for the contribution and very detailed pull request 🙌 Adding smooth scrolling to Starlight is something that we have considered, discussed and decided against in the past. To give a brief summary of some of the reasons:
After discussing this with the team, these reasons still hold and considering that users can implement smooth scrolling using custom CSS if they want to, we feel that it's better to keep the default behavior as it is. As usual, always happy to discuss and consider ideas either in a GitHub discussion or in the Astro Discord server. Thanks again for the PR. |
Didn't realize this had already been discussed. 😅 Thanks for the feedback, @HiDeoo. |
Description
Transitions can help orient users and communicate location within a site or document. This PR adds
scroll-behavior: smooth
tohtml
to enable scroll transitions between anchor links in the table of contents to help communicate position within a page.scroll-behavior: smooth
is not added for people who haveprefers-reduced-motion
set to true.Before:
no-smooth-scroll.mp4
After:
with-smooth-scroll.mp4