From a39dcf3d6362d9f4ea1dbae1112d727c15e73974 Mon Sep 17 00:00:00 2001 From: Madelyn Olson Date: Mon, 16 Nov 2026 17:52:03 -0800 Subject: [PATCH 1/7] Keep the docs menu in view while the page scrolls The docs menu scrolled away with the page, leaving an empty column next to long topic and command pages. On wide screens it now sticks to the top of the window, at most a window tall, and scrolls on its own. If the current page's entry starts out of view, the menu scrolls to it. On narrow screens the menu came after the page content, so it was at the bottom of long pages. It now sits above the content as a closed "Documentation menu" toggle. Signed-off-by: Madelyn Olson --- sass/_valkey.scss | 70 +++++++++++++++++++++++++++++++++++++++ templates/left-aside.html | 28 ++++++++++++++-- 2 files changed, 96 insertions(+), 2 deletions(-) diff --git a/sass/_valkey.scss b/sass/_valkey.scss index d0f2248c..12477d5f 100644 --- a/sass/_valkey.scss +++ b/sass/_valkey.scss @@ -584,6 +584,76 @@ p { } } } + + // The docs menu (templates/left-aside.html) goes above the page on narrow + // screens. On wide screens .docs-sidebar has the padding instead. + .docs-aside { + order: -1; + + @include respond-min(1024px) { + order: 0; + padding: 0; + } + } +} + +// Narrow screens: a toggle that opens the menu. Wide screens: the menu sticks +// to the top of the window, at most a window tall, and scrolls on its own. +.docs-sidebar { + > summary { + display: flex; + justify-content: space-between; + align-items: center; + padding: 1rem 1.6rem; + border-radius: 10px; + background-color: #fff; + font-weight: 700; + color: #000; + cursor: pointer; + list-style: none; + + &::-webkit-details-marker { + display: none; + } + + // Chevron, as in the menu's sections. + &::after { + content: ''; + width: 0.7rem; + height: 0.7rem; + border-right: 2px solid currentColor; + border-bottom: 2px solid currentColor; + transform: rotate(-45deg); + } + + &:focus-visible { + outline: 2px solid #2054B2; + outline-offset: 1px; + } + } + + &[open] > summary { + margin-bottom: 1rem; + + &::after { + transform: rotate(45deg); + } + } + + @include respond-min(1024px) { + position: sticky; + top: 0; + max-height: 100vh; + overflow-y: auto; + overscroll-behavior: contain; + scrollbar-width: thin; + scrollbar-color: #c5cdea transparent; + padding: 2rem; + + > summary { + display: none; + } + } } .docs-menu { diff --git a/templates/left-aside.html b/templates/left-aside.html index 8ec70914..1089f29f 100644 --- a/templates/left-aside.html +++ b/templates/left-aside.html @@ -10,8 +10,32 @@ {% block main_content %}{% endblock main_content %} -