Building a Table of Contents with the Intersection Observer API

1 · T.J. Fogarty · Sept. 8, 2018, 10:31 a.m.
While planning out an upcoming post, I noticed there was quite a lot of content to cover with no easy way to navigate it. So, rather than actually write the post, I went off on a tangent and built a table of contents component. Great, back to writing… ah it’d be nice if it followed the user scrolling down the page. OK, done. Wait, it would be cool if I could highlight the currently active section…...