From ec42ec36e65d8204acf18cc9ae940505c75a0aff Mon Sep 17 00:00:00 2001 From: techfg Date: Fri, 19 Apr 2024 02:10:29 -0700 Subject: [PATCH] fix: add right sidebar scrollbar (#1746) --- packages/starlight/components/PageSidebar.astro | 1 + .../starlight/components/TwoColumnContent.astro | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/starlight/components/PageSidebar.astro b/packages/starlight/components/PageSidebar.astro index 97caff9fab9..a3a17361499 100644 --- a/packages/starlight/components/PageSidebar.astro +++ b/packages/starlight/components/PageSidebar.astro @@ -54,6 +54,7 @@ import TableOfContents from 'virtual:starlight/components/TableOfContents'; ) * 0.25 /* MAGIC NUMBER 🥲 */ ) ); + width: auto; } } diff --git a/packages/starlight/components/TwoColumnContent.astro b/packages/starlight/components/TwoColumnContent.astro index 5eefb3e79ac..903848469a7 100644 --- a/packages/starlight/components/TwoColumnContent.astro +++ b/packages/starlight/components/TwoColumnContent.astro @@ -30,14 +30,14 @@ import type { Props } from '../props'; } .right-sidebar { - position: fixed; - top: 0; + position: sticky; + top: var(--sl-nav-height); border-inline-start: 1px solid var(--sl-color-gray-6); - padding-top: var(--sl-nav-height); - width: 100%; - height: 100vh; - overflow-y: auto; - scrollbar-width: none; + max-width: var(--sl-sidebar-width); + width: auto; + height: calc(100vh - var(--sl-nav-height)); + overflow-y: auto; + margin-right: var(--sl-sidebar-pad-x); } .main-pane {