Skip to content

Commit abe624e

Browse files
docs: fix API docs sidebar overscroll from topbar offset (#49)
Scalar's --scalar-y-offset shifts the sidebar's top position below the WarpTopbar, but doesn't reduce the sidebar's total height. This caused the sidebar to extend past the viewport bottom by exactly the topbar height (3.5rem mobile / 4rem desktop), producing a slight overscroll at the top and bottom of the main scroll area. Fix: add max-height: calc(100vh - var(--warp-topbar-height)) to the .sidebar class in the Scalar customCss block. Co-authored-by: Oz <oz-agent@warp.dev>
1 parent 62fd5fa commit abe624e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/pages/api.astro

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,14 @@ const specJson = JSON.stringify(specObject);
292292
--scalar-sidebar-item-active-background: #fafafa;
293293
--scalar-sidebar-item-hover-background: #fafafa;
294294
}
295+
/* Fix sidebar height: Scalar's --scalar-y-offset shifts the
296+
sidebar's top position below the topbar, but doesn't reduce
297+
the sidebar's total height. Without this, the sidebar extends
298+
past the viewport bottom by the topbar height, causing a
299+
slight overscroll at the top and bottom. */
300+
.sidebar {
301+
max-height: calc(100vh - var(--warp-topbar-height)) !important;
302+
}
295303
/* Hide Developer Tools toolbar */
296304
.references-developer-tools,
297305
.api-reference-toolbar { display: none !important; }

0 commit comments

Comments
 (0)