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

[doc ]Fixed navbar unwanted scroll behavior #1008

Closed
wants to merge 1 commit into from

Conversation

CapitaineToinon
Copy link
Contributor

Fixes for #875.

Like stated in the issue, the tabindex problem has been fixed in the latest version of svelte-kit but attempting the upgrade introduced other issues, such as css selector changing specificities, breaking some global styles.

When in comes to the unwanted scroll behavior, removing the scroll-padding-top property from the layout seems to do the trick. Even after reading and testing how this property behaves (never used to before to be honest!), I don't see how it was impactful or what the intended behavior was. Let me know if this PR breaks anything.

@saadeghi
Copy link
Owner

saadeghi commented Aug 9, 2022

scroll-padding-top: 5rem causes the page scroll to have a top padding when we open an anchor link on the page.

For example this link:
https://daisyui.com/components/alert/#success-color
points to a specific section of page (the element with #success-color ID).

Without scroll-padding-top page scrolls to to element (without considering the fixed navbar):

without

With scroll-padding-top page scrolls to to element with extra padding on top:

with

So I don't think removing scroll-padding-top would be a good trade-off, causing another UX issue.

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.

None yet

2 participants