This PR is intended to replace @inefable's sticky-menu-highlighted branch -- I've taken his styles and re-implemented the behaviour.
Notes:
This implementation doesn't require any adaptation of the content (HTML/md).
We've (notionally, at least) tried to set the bar for support at IE11 (no idea where we actually are w/r/t that bar, tbh, but...). For this reason the other standalone (non-transpiled) scripts on Jekyll-rendered pages have used ES5. Making this work on IE11 would require a polyfill and some other shennanigans, in addition to writing out all the ES6, so instead it seems appropriate to simply gracefully degrade for IE11 (read: just don't use this highlighting). The use of <script type="module"> effectively achieves this (but I would appreciate a test on Safari from someone with a Mac -- thanks!).
The only wrinkle I'm aware of with this is when scrolling back up -- the indicator moves when the heading comes into the viewport, but the top-bar menus is obscuring it. Its probably not as simple to solve as it might seem, so I'm proposing we leave it, unless it really offends people eyes :)
This PR is intended to replace @inefable's sticky-menu-highlighted branch -- I've taken his styles and re-implemented the behaviour.
Notes:
<script type="module">
effectively achieves this (but I would appreciate a test on Safari from someone with a Mac -- thanks!).