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 anchor tags scrolling to the wrong place when fixed navbar is enabled #82

Merged
merged 1 commit into from
Apr 7, 2024

Conversation

ButteredCats
Copy link
Contributor

Fixes #79

The site didn't account for the navbar being there when it jumps somewhere. Adding the scroll-padding-top attribute fixes this by telling the browser to scroll further.

I had to add the fixed_navbar class to html as otherwise you'd have to add it to each element you're jumping too, which would be far more complicated and would require actual code.
Every other reference to the fixed_navbar class in style.css is targeting the class for a specific type of element, so it doesn't have any extra effects but might be something to keep in mind if any more work is done with the class.

@sigaloid
Copy link
Member

sigaloid commented Apr 7, 2024

Thanks! 😄

@sigaloid sigaloid merged commit e6b9a2e into redlib-org:main Apr 7, 2024
3 checks passed
@ButteredCats ButteredCats deleted the fix_anchor_scroll branch April 7, 2024 16:14
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.

🐛 Bug Report: Anchor tags scroll too far up, hiding anchor text behind top Redlib header
2 participants