From 98977136c871d51aec36c1de2701240b855e22ad Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Wed, 4 Feb 2026 11:26:49 -0700 Subject: [PATCH] feat(docs): add CSS-only scrollspy for TOC navigation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use CSS Overflow Level 5 properties (scroll-target-group, :target-current) to highlight the current section in the sidebar TOC as the user scrolls. Progressive enhancement: gracefully degrades in unsupported browsers (Firefox, Safari) — they retain existing hover/click behavior. Browser support: Chrome 140+, Edge 140+, Opera 124+ (~65% global). --- docs/static/style.css | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/static/style.css b/docs/static/style.css index de6535b..b98670d 100644 --- a/docs/static/style.css +++ b/docs/static/style.css @@ -136,6 +136,20 @@ body { color: var(--accent); } +/* CSS-only scrollspy (progressive enhancement) + * Uses CSS Overflow Level 5: scroll-target-group + :target-current + * Browser support: Chrome 140+, Edge 140+, Opera 124+ + * Graceful degradation: unsupported browsers ignore these properties + */ +.sidebar .nav-anchors { + scroll-target-group: auto; +} + +.sidebar .nav-anchors .anchor-link:target-current { + color: var(--accent); + font-weight: 600; +} + /* Indent anchors by heading level */ .sidebar .nav-anchors .level-3 { margin-left: 0.5rem;