About this set
An “On this page” contents list that stays beside a long article and highlights the section being read. The layout is a two-column grid: a 230px sticky column for the contents and the article beside it. The current link turns indigo and bold with an indigo left border; the others sit on a light grey rail. Under 760px the contents move above the article and stop sticking. Use it for documentation, long guides, policies and changelogs. The links are ordinary anchors to the section ids, so the list works with JavaScript switched off, and headings have scroll-margin-top so a jump does not pin them to the top edge. A short script marks the current link with aria-current=”true”: as you scroll it picks the last section whose top has passed a line 30% down the viewport, and at the very bottom of the page it picks the last section, so a short final section still gets highlighted. Clicking a link marks it straight away. The Bootstrap version lets the Scrollspy plugin set .active and mirrors that to aria-current.
What’s included
- Sticky contents column beside the article, stacked above it under 760px
- Current section marked with aria-current="true" and an indigo rail
- Plain anchor links that work without JavaScript
- Last section highlighted when the page reaches the bottom
- Bootstrap version uses the Scrollspy plugin
Accessibility
The contents are a list of links in a nav labelled by its visible "On this page" heading, and the link for the section in view carries aria-current="true". Links show an indigo :focus-visible outline, headings have scroll-margin-top for anchor jumps, and the colour transitions switch off under prefers-reduced-motion.
Customise it
Change --toc-accent, --toc-ink, --toc-muted and --toc-line on .doc, and the 230px column and 30px sticky offset. Move the trigger line by editing innerHeight * 0.3 in the script (data-bs-root-margin in Bootstrap). In Tailwind edit the aria-[current=true]: utilities.



















