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

Current section should be highlighted in ToC of usercss styles #1451

Closed
setyb opened this issue Jun 29, 2022 · 3 comments
Closed

Current section should be highlighted in ToC of usercss styles #1451

setyb opened this issue Jun 29, 2022 · 3 comments

Comments

@setyb
Copy link

setyb commented Jun 29, 2022

Bug Report

Bug Description

The current section is not always highlighted in the table of contents.

Inside #toc, the current li element is not always assigned the .current class. I've noticed this when writing userCSS styles that use the default preprocessor.

During testing, I also noticed that multiple li elements inside #toc will be assigned data-focused-via-click="", which may be indicative of the same, or another, bug.

System Information

  • OS: Linux
  • Browser: Firefox 102
  • Stylus Version: v1.5.25
@tophf
Copy link
Member

tophf commented Jun 29, 2022

Yes, usercss styles don't have such highlight at all because I thought the implementation would be too slow. I'll look into it again and try to find a faster method, probably less reliable.

There's no problem with the data attribute.

@tophf tophf changed the title [Bug] Current section not always highlighted in table of contents Current section should be highlighted in ToC of usercss styles Jun 29, 2022
@setyb
Copy link
Author

setyb commented Jul 3, 2022

Yes, usercss styles don't have such highlight at all because I thought the implementation would be too slow. I'll look into it again and try to find a faster method, probably less reliable.

Thanks. I hope you are able to find a good solution.

There's no problem with the data attribute.

Thanks for checking on that. What function does it serve to have multiple li elements within #toc assigned the data-focused-via-click attribute? I ask because, although it may take some tweaking, that attribute could possibly help with the goal of highlighting the current section. Or not. ;)

@tophf
Copy link
Member

tophf commented Jul 3, 2022

The attribute is unrelated. We use it to control when the focus outline should be shown.

@tophf tophf closed this as completed in c303807 Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants