carpentries / tnd-carpentries-working

The Carpentries new website BEFORE the Hugo theme was packaged out. Not currently maintained.
https://tnd-carpentries-website.netlify.app/
0 stars 0 forks source link

Styling current section in sidebar TOC not working properly #26

Closed maneesha closed 4 months ago

maneesha commented 5 months ago

Similarly to #25, when scrolling/navigating down a page, the current section in the TOC (autogenerated from H2) should be styled. It looks like this is happening but is not working consistently. See for example what happens when scrolling through sections on this preview page.

AdamChlan commented 5 months ago

@maneesha we are going to need to create a script to modify the HTML so that each section is wrapped in the ID that controls the active state. We will work on this.

AdamChlan commented 4 months ago

@maneesha I have a PR open here with an improved version of the TOC active state. It is a bit tricky mainly because there are some sections that don't have a lot of content, and so several sections can appear in the window at the same time. This version is an improvement over what we currently have though:

Here is the preview: https://deploy-preview-106--tnd-carpentries-website.netlify.app