From 550008212800ab744c4242559eb452450eebc790 Mon Sep 17 00:00:00 2001 From: Jonathan Sick Date: Tue, 18 Jun 2024 15:04:45 -0400 Subject: [PATCH] Make sidebar sticky Do this by making the contents area max out to 100vh so that it scrolls independently of the sidebar. --- src/assets/styles/base/_layout.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/assets/styles/base/_layout.scss b/src/assets/styles/base/_layout.scss index 96cdcd6..6824dc9 100644 --- a/src/assets/styles/base/_layout.scss +++ b/src/assets/styles/base/_layout.scss @@ -120,6 +120,7 @@ body { .technote-container { grid-template-columns: var(--tn-sidebar-width) 1fr; grid-template-rows: auto 1fr; + height: 100vh; /* Full height to allow for sticky sidebar */ } .technote-logo-container { @@ -139,6 +140,9 @@ body { grid-column: 2 / 3; grid-row: 1 / 3; + /* Allow overflow because .technote-container is full height */ + overflow-y: auto; + /* Create a grid within article to constrain content but allow full-bleed blocks. */