From 8de8505f8c13588a49ba0067c823b5ed1507297c Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 5 Nov 2026 00:27:29 +0000 Subject: [PATCH] fix(docs): center the content on wide screens - Keep the table of contents at most 3rem wider than the sidebar - Center the content between the two sidebars - Use a content width of 52rem from a window width of 110rem Co-Authored-By: Claude Opus 5.5 --- docs/src/styles/theme.css | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/src/styles/theme.css b/docs/src/styles/theme.css index ffc3e332..17163e01 100644 --- a/docs/src/styles/theme.css +++ b/docs/src/styles/theme.css @@ -666,3 +666,25 @@ html[data-has-hero] { html[data-has-hero] .content-panel { padding-top: 1rem; } + +/* Wide screens: Starlight lets the table of contents grow with the window, so a wide window + shows a large empty column at the right. Keep the table of contents narrow and center the + content in the space between the two sidebars. */ +@media (min-width: 72rem) { + .right-sidebar-container { + width: min( + max(var(--sl-sidebar-width), calc(var(--sl-sidebar-width) + (100% - var(--sl-content-width) - var(--sl-sidebar-width)) / 2)), + calc(var(--sl-sidebar-width) + 3rem) + ); + } + [data-has-sidebar][data-has-toc] .main-pane { + --sl-content-margin-inline: auto; + width: calc(100% - min( + max(var(--sl-sidebar-width), calc(var(--sl-sidebar-width) + (100% - var(--sl-content-width) - var(--sl-sidebar-width)) / 2)), + calc(var(--sl-sidebar-width) + 3rem) + )); + } +} +@media (min-width: 110rem) { + :root { --sl-content-width: 52rem; } +}