From 26060a8294eb5b7f0cf6b83471071d595f301b1f Mon Sep 17 00:00:00 2001
From: Bruno Mercier Costa <94469565+emrcbrn@users.noreply.github.com>
Date: Thu, 22 Oct 2026 16:45:08 +0200
Subject: [PATCH] Center the docs layout on wide screens and raise body text to
15px (#1060)
* docs: center the layout on wide screens and raise body text to 15px
The layout capped its width with max-w-8xl, which this Tailwind config
does not define, so the cap never applied. On screens wider than about
1660px the sidebar and header stayed at the viewport edges while the
text kept its max width, leaving a gap between the text and the table
of contents (about 350px at 1920, over 1000px at 2560).
Keep the sidebar, content and table of contents together in a 104rem
frame centered in the viewport. Below 104rem the layout is unchanged.
Raise the prose base font size from 14px to 15px, and h5/h6 with it so
they stay level with the body text.
* docs: center the layout frame without counting the scrollbar
100vw includes a classic vertical scrollbar, so the offset came out
half a scrollbar too large and the in-flow content ended 15px past the
fixed header. 100% resolves against the viewport without the scrollbar
for the fixed sidebar and header, and against the page width for the
content, so all three use the same exact offset.
---
src/components/Header.jsx | 4 ++--
src/components/Layout.jsx | 4 ++--
src/styles/tailwind.css | 6 ++++++
typography.js | 6 +++---
4 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/src/components/Header.jsx b/src/components/Header.jsx
index e23b967c..9c15dd13 100644
--- a/src/components/Header.jsx
+++ b/src/components/Header.jsx
@@ -37,9 +37,9 @@ export const Header = forwardRef(function Header({ className }, ref) {
ref={ref}
className={clsx(
className,
- 'fixed inset-x-0 top-0 z-40 flex items-center justify-between gap-3 px-5 transition h-[64px] lg:left-72 lg:z-50 lg:px-8 xl:left-80 min-h-[64px] lg:pointer-events-auto',
+ 'fixed inset-x-0 top-0 z-40 flex items-center justify-between gap-3 px-5 transition h-[64px] lg:left-[calc(var(--layout-offset)+18rem)] lg:right-[var(--layout-offset)] lg:z-50 lg:px-8 xl:left-[calc(var(--layout-offset)+20rem)] min-h-[64px] lg:pointer-events-auto',
!isInsideMobileNavigation &&
- 'backdrop-blur-lg bg-white/70 dark:bg-[#181A1D]/95 lg:left-72 xl:left-80',
+ 'backdrop-blur-lg bg-white/70 dark:bg-[#181A1D]/95',
isInsideMobileNavigation &&
'bg-white/70 dark:bg-[#181A1D]/95 backdrop-blur-lg'
)}
diff --git a/src/components/Layout.jsx b/src/components/Layout.jsx
index 4eefa80c..ba27e134 100644
--- a/src/components/Layout.jsx
+++ b/src/components/Layout.jsx
@@ -188,12 +188,12 @@ export function Layout({ children, title, tableOfContents }) {