Skip to content

Commit

Permalink
Fix sidebar scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonRomano committed Dec 18, 2024
1 parent 945e0ba commit d6600a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/pages/docs/[...path]/DocsPage.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@
@media (max-width: 784px) {
display: none;
}
border-right: 1px solid var(--gray-2);
& .sidebarContentWrapper {
position: sticky;
top: var(--header-height);
height: calc(100vh - var(--header-height));
border-right: 1px solid var(--gray-2);
padding: 24px 14px 48px;
min-height: calc(100vh - var(--header-height) - var(--footer-height));
max-height: calc(100vh - var(--header-height));
padding: 24px 14px;
overflow: scroll;

& > .sidebarNavTree {
padding: 2px; /* guarantee space for focus border */
height: 100%;
overflow: scroll;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ body {
/* The total height of the header, including all padding, etc.
this is needed to calculate sticky positioning for other elements. */
--header-height: 72px;
--footer-height: 87px;

max-width: 100vw;
--brand-color: #3551F3;
Expand Down

0 comments on commit d6600a1

Please sign in to comment.