feat(docs): add CSS-only scrollspy for TOC navigation
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).
This commit is contained in:
14
docs/static/style.css
vendored
14
docs/static/style.css
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user