researchops / toolbox

5 stars 1 forks source link

Add a scroll spy feature to the toc-items #24

Open andypbrowne opened 2 years ago

andypbrowne commented 2 years ago

As the user scrolls past a heading in the main content area there will be an indication (bold text) in the left navigation toc-item as to the current location on the page. This will help with wayfinding and perception of distance on what is often a very tall page on this site.

Reference: https://svelte-use-io.byderek.com/

andypbrowne commented 2 years ago

I experimented with the development tools and think that the current toc-item could be styled this way

li.toc-item:nth-child(2) {
  font-weight: 600;
  color: var(--color-midnight-100);

}