diff --git a/docs/public/index.css b/docs/public/index.css index 9ccbabd32..ee0673702 100644 --- a/docs/public/index.css +++ b/docs/public/index.css @@ -463,5 +463,5 @@ h2.heading { /* Screenreader Only Text - End */ :target { - scroll-margin-top: 4rem; + scroll-margin: calc(var(--theme-sidebar-offset, 5rem) + 2rem) 0 2rem; } diff --git a/docs/src/layouts/Main.astro b/docs/src/layouts/Main.astro index 332147cf3..c3b08b242 100644 --- a/docs/src/layouts/Main.astro +++ b/docs/src/layouts/Main.astro @@ -214,7 +214,7 @@ if (currentPage) { } :global(.mobile-sidebar-toggle) #sidebar-site { display: block; - top: 0; + top: 2rem; } .block { display: block; @@ -235,12 +235,14 @@ if (currentPage) { #sidebar-site { display: flex; padding-left: 2rem; + position: sticky; } :global(.mobile-sidebar-toggle) { overflow: initial; } :global(.mobile-sidebar-toggle) #sidebar-site { display: flex; + top: 0; } .menu-toggle { display: none; @@ -254,9 +256,6 @@ if (currentPage) { #article { grid-column: 2; } - #sidebar-site { - position: sticky; - } #sidebar-content { /* display: flex; */ grid-column: 3;