diff --git a/landing/src/styles/globals.css b/landing/src/styles/globals.css index 8bd564ff..276f2084 100644 --- a/landing/src/styles/globals.css +++ b/landing/src/styles/globals.css @@ -373,15 +373,33 @@ html:not([data-anchor-scrolling]) { display: none; } -/* Sticky positioning is broken inside the fumadocs grid. Use fixed instead. */ +/* Sidebar: fixed positioning so it never scrolls with content, but only when expanded */ @media (min-width: 768px) { - [data-sidebar-placeholder] { + [data-sidebar-placeholder]:not(:has(#nd-sidebar[data-collapsed="true"])) { position: fixed !important; width: var(--fd-sidebar-width) !important; inset-inline-start: max(0px, calc((100vw - var(--fd-layout-width, 97rem)) / 2)) !important; } } +@media (max-width: 767px) { + :root { + --subnav-height: 3.5rem; + } + + #nd-subnav { + position: fixed !important; + top: var(--fd-docs-row-1, 0px) !important; + inset-inline-start: 0 !important; + inset-inline-end: 0 !important; + } + + /* Compensate for fixed #nd-subnav leaving grid flow */ + [data-toc-popover] { + margin-top: var(--subnav-height); + } +} + [data-toc-popover] > header { position: fixed !important; top: var(--fd-docs-row-2, 0px) !important;