From e0f64d4b545ce00bbd60bc777fa5a2adb49c279e Mon Sep 17 00:00:00 2001 From: David McGuire <78670493+davidmcguiredesign@users.noreply.github.com> Date: Sat, 4 Jan 2025 16:24:07 -0800 Subject: [PATCH] Sticky breadcrumb and sidebar navs Both the breadcrumb (parent) and sidebar (sibling) navs provide key context while reading the page. Making them sticky (and optionally giving the sidebar nav its own scroll context) makes their context available to the whole page, not just the start. --- styles/theme-base.css | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/styles/theme-base.css b/styles/theme-base.css index beec0bc1f9..9d9e69aece 100644 --- a/styles/theme-base.css +++ b/styles/theme-base.css @@ -532,6 +532,10 @@ pre.info { padding:.75rem 1.5rem 1.5rem; -moz-box-sizing:border-box; box-sizing:border-box; + position: sticky; + top: 3rem; + max-height: calc(100vh - 3rem); + overflow: auto; } #layout-content { padding:1.5rem; @@ -1352,6 +1356,10 @@ div.soft-deprecation-notice blockquote.sidebar { @media (min-width: 768px) { #breadcrumbs { display:block; + position: sticky; + top: 0px; + background: var(--dark-grey-color); + z-index: 1; } #intro .background, aside.tips, @@ -1363,6 +1371,7 @@ div.soft-deprecation-notice blockquote.sidebar { #layout-content { float:left; width:75%; + border-top-left-radius: 1rem; } }