-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
highlight nav item in onPageNav ToC when scrolling (add scrollspy) #1024
Comments
I know you can use Bootstrap and implement it that way, but for various reasons we didn't want to have to import Bootstrap just for one feature. This solution ended up working for me - it could be incorporated into Docusaurus 2.0 quite simply IMO: https://github.com/Khan/KaTeX/pull/1557/files |
My bad. I am putting the comment above so that the expected behavior can be known |
@endiliey can i work on this? |
@tanhauhau it's yours! I've added an "issue: claimed" label so that others will know not to start work on the issue. If you change your mind about the issue, no worries! Just let me know so that I can remove the label and free it up for someone else to claim. I'll check in with you periodically so that we can keep the task updated with the progress. |
@tanhauhau Thank you! This is how we ended up implementing it, if you need an example: https://docs.stackery.io/docs/using-stackery/dashboard/ |
@bildungsroman - Hi. Unrelated to this issue, but I am curious if you are willing to put stackery.io on our user showcase page? https://docusaurus.io/en/users |
I'd love to! Is it ok that we're not fully open-source, though? |
Absolutely. Please do. |
🚀 Feature
Highlight the current section in the onPageNav ToC that the reader has scrolled to, either by a background color or bold or adding a customizable CSS class.
Basically, the way scrollspy works in Bootstrap.
Have you read the Contributing Guidelines on issues?
Yup.
Motivation
If a page has a long ToC (i.e. most of our tutorial pages have 9-10 steps), it would make it a lot easier for the reader to know where they are if the current step they have scrolled to is somehow highlighted in the ToC.
Pitch
This could be a universal feature in Docusaurus 2.0. I think it would make Docusaurus sites look even more professional.
The text was updated successfully, but these errors were encountered: