diff options
author | 2021-07-29 15:31:18 -0500 | |
---|---|---|
committer | 2021-07-29 16:31:18 -0400 | |
commit | 908139642a7863ce38e567f791aee1972ab6ec1f (patch) | |
tree | 15674dd7e9ea8542b6efed8e97a2b0f119da4dae /docs | |
parent | cd2b5df49c28a2fa6454ab71449fd20ba9ef31f9 (diff) | |
download | astro-908139642a7863ce38e567f791aee1972ab6ec1f.tar.gz astro-908139642a7863ce38e567f791aee1972ab6ec1f.tar.zst astro-908139642a7863ce38e567f791aee1972ab6ec1f.zip |
📘 DOC: Improve SiteSidebar styles on mobile (#939)
Diffstat (limited to 'docs')
-rw-r--r-- | docs/public/index.css | 2 | ||||
-rw-r--r-- | docs/src/layouts/Main.astro | 7 |
2 files changed, 4 insertions, 5 deletions
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; |