Skip to content

Commit

Permalink
fix: add sidebar scroll (#521)
Browse files Browse the repository at this point in the history
  • Loading branch information
crowlKats committed May 15, 2024
1 parent e5ccd65 commit 4389058
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion frontend/components/NavOverflow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ for (let i = 0; i < navItemsEl.children.length; i++) {
}
const active = navItemsEl.querySelector("[data-active]");
console.log(active, navItems.get(active));
function updateNavItems() {
const navWidth = navItemsEl.parentElement.offsetWidth;
Expand Down
4 changes: 2 additions & 2 deletions frontend/routes/package/(_components)/Docs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export function DocsView(
)}
</div>
{docs.toc && (
<div class="max-lg:row-start-1 lg:col-[span_1_/_-1] lg:top-0 lg:sticky lg:max-h-screen box-border space-y-4 -mt-4 pt-4">
<div class="max-lg:row-start-1 lg:col-[span_1_/_-1] lg:top-0 lg:sticky lg:max-h-screen flex flex-col box-border gap-y-4 -mt-4 pt-4">
{!docs.breadcrumbs && (
<LocalSymbolSearch
scope={params.scope}
Expand All @@ -98,7 +98,7 @@ export function DocsView(
)}

<div
class="ddoc w-full lg:*:max-h-[calc(100vh-55px)] b-0"
class="ddoc w-full overflow-scroll pb-4"
dangerouslySetInnerHTML={{ __html: docs.toc }}
/>
</div>
Expand Down
4 changes: 4 additions & 0 deletions frontend/static/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,10 @@ body .ddoc .toc {
}
}

body .ddoc:has(.toc) {
scrollbar-width: thin;
}

/* These might seem redundant but Tailwind won't always load them in the compiled stylesheet unless they're explicitly included here. */
.score-ring-red {
@apply bg-red-500;
Expand Down

0 comments on commit 4389058

Please sign in to comment.