Skip to content

Commit f462307

Browse files
committed
docs(layout): widen content to 1200px and align header to combined layout width\n\n- Set to 1200px\n- Header max-width = sidebar + gap + content + gap + toc\n- Compensate asymmetry with translateX((toc - sidebar)/2)\n- Lock logo slot to sidebar width\n- Remove stray 24px padding and restore ~px-3 gutters across breakpoints
1 parent 275f617 commit f462307

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

src/components/docPage/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ export function DocPage({
126126
</aside>
127127
)}
128128
</section>
129-
<style>{`:root { --doc-content-w: 100ch; } #doc-content { max-width: var(--doc-content-w); }`}</style>
129+
<style>{`:root { --doc-content-w: 1200px; } #doc-content { max-width: var(--doc-content-w); }`}</style>
130130
<style>{`
131131
@media (min-width: 2057px) {
132132
:root {
133-
--doc-content-w: 100ch;
133+
--doc-content-w: 1200px;
134134
--toc-w: 250px;
135135
--gap: 24px;
136136
}

src/components/header.tsx

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function Header({
3232
<header className="bg-[var(--gray-1)] h-[var(--header-height)] w-full z-50 border-b border-[var(--gray-a3)] fixed top-0">
3333
{/* define a header-height variable for consumption by other components */}
3434
<style>{':root { --header-height: 80px; }'}</style>
35-
<nav className="mx-auto px-6 lg:px-8 py-2 flex items-center">
35+
<nav className="nav-inner mx-auto px-3 py-2 flex items-center">
3636
{pathname !== '/' && (
3737
<button className="lg:hidden mr-3">
3838
<label
@@ -53,7 +53,7 @@ export function Header({
5353
<Link
5454
href="/"
5555
title="Sentry error monitoring"
56-
className="flex flex-shrink-0 items-center lg:w-[calc(var(--sidebar-width,300px)-2rem)] text-2xl font-medium text-[var(--foreground)]"
56+
className="logo-slot flex flex-shrink-0 items-center lg:w-[calc(var(--sidebar-width,300px)-2rem)] text-2xl font-medium text-[var(--foreground)]"
5757
>
5858
<div className="h-full pb-[6px]">
5959
<Image
@@ -91,6 +91,32 @@ export function Header({
9191
<MobileMenu pathname={pathname} searchPlatforms={searchPlatforms} />
9292
</div>
9393
</nav>
94+
<style>{`
95+
/* Align header width with content + sidebars at wide screens */
96+
@media (min-width: 2057px) {
97+
header .nav-inner {
98+
/* total layout width = sidebar + gap + content + gap + toc */
99+
max-width: calc(
100+
var(--sidebar-width, 300px)
101+
+ var(--gap, 24px)
102+
+ var(--doc-content-w, 1200px)
103+
+ var(--gap, 24px)
104+
+ var(--toc-w, 250px)
105+
);
106+
margin-left: auto;
107+
margin-right: auto;
108+
/* center, then compensate if sidebar != toc */
109+
transform: translateX(calc((var(--toc-w, 250px) - var(--sidebar-width, 300px)) / 2));
110+
/* restore small internal padding (≈ Tailwind px-3) */
111+
padding-left: 0.75rem;
112+
padding-right: 0.75rem;
113+
}
114+
/* Ensure the left logo area equals sidebar width */
115+
header .nav-inner .logo-slot {
116+
width: var(--sidebar-width, 300px);
117+
}
118+
}
119+
`}</style>
94120
</header>
95121
);
96122
}

0 commit comments

Comments
 (0)