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

Allow scrolling to be disabled when linking to a section within a page #753

Open
KevinMusgrave opened this issue Aug 9, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@KevinMusgrave
Copy link

KevinMusgrave commented Aug 9, 2023

Context

If you click on this link: https://sphinx-book-theme.readthedocs.io/en/stable/components/source-files.html#source-files-repository

it starts at the top of the page, and then after a moment, scrolls down to the section.

It would be much nicer to immediately jump to the section, rather than scrolling.

For example, this link brings you to the section immediately, without any scrolling: https://kevinmusgrave.github.io/pytorch-metric-learning/losses/#histogramloss

Proposal

Allow the scrolling behavior to be disabled.

Tasks and updates

No response

@KevinMusgrave KevinMusgrave added the enhancement New feature or request label Aug 9, 2023
@welcome
Copy link

welcome bot commented Aug 9, 2023

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

@KevinMusgrave KevinMusgrave changed the title Allow scrolling to be disabled when linking to an anchor Allow scrolling to be disabled when linking to a section within a page Aug 9, 2023
@KevinMusgrave
Copy link
Author

Adding this to a custom css file seems to work:

html {
  scroll-behavior: auto !important;
}

Is this the best approach?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant