diff --git a/src/css/custom.scss b/src/css/custom.scss index f1319ac2b8a..67d9f85c34e 100644 --- a/src/css/custom.scss +++ b/src/css/custom.scss @@ -88,6 +88,7 @@ --normal-box-radius: 10px; --doc-sidebar-width: 280px; --docs-nav-margin: 60px; + --doc-toc-width: 288px; /* === Docusaurus / Infima overrides ========================== */ --ifm-color-primary: var(--brand-orange-deep); @@ -185,6 +186,14 @@ --global-main-width: 100%; } } + +/* Docs pages need far more room than the marketing pages: the layout has to + fit the left sidebar, the TOC and the article itself. Let them use the whole + viewport (capped so lines stay readable on ultra-wide screens) instead of + the 1200px shared with the rest of the site. */ +html.docs-wrapper { + --global-main-width: min(100%, 1920px); +} @media screen and (max-width: 1024px) { :root { --mobile-padding-width: 24px; diff --git a/src/theme/DocItem/Layout/index.tsx b/src/theme/DocItem/Layout/index.tsx index 0d40e192f1a..b9f95aef417 100644 --- a/src/theme/DocItem/Layout/index.tsx +++ b/src/theme/DocItem/Layout/index.tsx @@ -58,7 +58,11 @@ export default function DocItemLayout({ children }: Props): JSX.Element { - {docTOC.desktop &&
{docTOC.desktop}
} + {docTOC.desktop && ( +
+ {docTOC.desktop} +
+ )} ); } diff --git a/src/theme/DocItem/Layout/styles.module.css b/src/theme/DocItem/Layout/styles.module.css index 25efe7621c2..35940c2b7e2 100644 --- a/src/theme/DocItem/Layout/styles.module.css +++ b/src/theme/DocItem/Layout/styles.module.css @@ -3,13 +3,27 @@ margin-top: 0; } -@media (min-width: 1024px) { +/* 1280px is where design-style.scss stops hiding the TOC column, so the two + have to agree. When they disagreed (1280 vs 1440), everything between those + two widths rendered the TOC alongside an article still claiming 100%, which + squeezed the TOC down to ~185px. */ +@media (min-width: 1280px) { + /* The TOC only needs a fixed column; every remaining pixel goes to the + article instead of being locked up in a percentage-based col--3. */ .docItemCol { - max-width: 70% !important; - margin-right: 40px; + flex: 1 1 auto; + max-width: calc(100% - var(--doc-toc-width)) !important; + margin-right: 0; + } + + /* !important: Infima's own .col--3 rule (flex: 0 0 25%) wins otherwise. */ + .docTocCol { + flex: 0 0 var(--doc-toc-width) !important; + max-width: var(--doc-toc-width); } } -@media screen and (max-width: 1440px) { +/* Below 1280px the TOC is hidden, so the article spans the full width. */ +@media screen and (max-width: 1280px) { .docItemCol { max-width: calc(100%) !important; margin-right: 0; diff --git a/src/theme/DocRoot/Layout/Main/styles.module.css b/src/theme/DocRoot/Layout/Main/styles.module.css index b332be8b6fd..68f03ac76fa 100644 --- a/src/theme/DocRoot/Layout/Main/styles.module.css +++ b/src/theme/DocRoot/Layout/Main/styles.module.css @@ -19,7 +19,7 @@ ) !important; } } -@media screen and (max-width: 1440px) { +@media screen and (max-width: 1280px) { .docMainContainer { max-width: calc( 100vw - var(--doc-sidebar-width) - var(--docs-nav-margin) - 140px diff --git a/src/theme/DocRoot/Layout/styles.module.scss b/src/theme/DocRoot/Layout/styles.module.scss index 11cc003aa66..4557d599e44 100644 --- a/src/theme/DocRoot/Layout/styles.module.scss +++ b/src/theme/DocRoot/Layout/styles.module.scss @@ -12,10 +12,7 @@ .docsWrapper { display: flex; flex: 1 0 auto; - @media screen and (min-width: 1600px) { - width: 1600px !important; - max-width: 1600px !important; - } + width: 100%; @media screen and (min-width: 1024px) { table { th {