File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -373,15 +373,33 @@ html:not([data-anchor-scrolling]) {
373373 display : none;
374374}
375375
376- /* Sticky positioning is broken inside the fumadocs grid. Use fixed instead. */
376+ /* Sidebar: fixed positioning so it never scrolls with content, but only when expanded */
377377@media (min-width : 768px ) {
378- [data-sidebar-placeholder ] {
378+ # nd-sidebar {
379+ will-change : transform;
380+ }
381+
382+ [data-sidebar-placeholder ]: not (: has (# nd-sidebar [data-collapsed = "true" ])) {
379383 position : fixed !important ;
380384 width : var (--fd-sidebar-width ) !important ;
381385 inset-inline-start : max (0px , calc ((100vw - var (--fd-layout-width , 97rem )) / 2 )) !important ;
382386 }
383387}
384388
389+ @media (max-width : 767px ) {
390+ # nd-subnav {
391+ position : fixed !important ;
392+ top : var (--fd-docs-row-1 , 0px ) !important ;
393+ inset-inline-start : 0 !important ;
394+ inset-inline-end : 0 !important ;
395+ }
396+
397+ /* Compensate for fixed #nd-subnav leaving grid flow */
398+ [data-toc-popover ] {
399+ margin-top : 3.5rem ;
400+ }
401+ }
402+
385403[data-toc-popover ] > header {
386404 position : fixed !important ;
387405 top : var (--fd-docs-row-2 , 0px ) !important ;
You can’t perform that action at this time.
0 commit comments