From 6275b876c102423f5bd4d5bd1919a5d4829f9086 Mon Sep 17 00:00:00 2001 From: Zhiben Chen Date: Tue, 8 Sep 2026 21:22:40 -0400 Subject: [PATCH] Center reading column between sidebars on wide screens --- src/styles/site.css | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/styles/site.css b/src/styles/site.css index 5f8f4d0..c461ef3 100644 --- a/src/styles/site.css +++ b/src/styles/site.css @@ -124,3 +124,26 @@ html:has(.landing) main { padding-top: 0; } @media(prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } } .sidebar-content summary .large { text-transform: capitalize; } + +/* Keep the reading column centered between equal sidebars on wide screens. */ +@media (min-width: 72rem) { + html[data-has-sidebar] { --docs-layout-width: 94rem; } + html[data-has-sidebar] .main-frame { + width: 100%; + max-width: var(--docs-layout-width); + margin-inline: auto; + } + html[data-has-sidebar] .sidebar-pane { + inset-inline-start: max(0px, calc((100% - var(--docs-layout-width)) / 2)); + } + html[data-has-sidebar][data-has-toc] .main-pane { + --sl-content-margin-inline: auto; + width: calc(100% - var(--sl-sidebar-width)); + min-width: 0; + } + html[data-has-sidebar] .right-sidebar-container, + html[data-has-sidebar] .right-sidebar { + width: var(--sl-sidebar-width); + flex-shrink: 0; + } +}