-
Notifications
You must be signed in to change notification settings - Fork 11
fix(Main): Handle scrolling to anchor links #65
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
Conversation
| const hash = window.location.hash | ||
|
|
||
| // Without this, page would focus on anchor link without scrolling to it | ||
| history.replaceState(null, '', ' ') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally open to suggestions here if we hate this.
thatblindgeye
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, had a question below but not really blocking
|
|
||
| .ws-heading { | ||
| position: relative; | ||
| scroll-margin-top: 3rem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if I'm noticing any difference when removing this line, is it necessary for anything in particular?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
🎉 This PR is included in version 1.8.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |


I used a timeout here because we have islands and I wasn't sure if we wanted to specifically look for anchor links instead - let me know if that's the preferred solution.
Tested with CSS var links with content.ts commented in.
Fixes #56.