Skip to content

Commit 2bdc073

Browse files
waleedlatif1claude
andauthored
fix(docs): use named grid lines instead of numeric column indices (#3487)
Root cause: the fumadocs grid template has 3 columns in production but 5 columns in local dev. Our CSS used `grid-column: 3 / span 2` which targeted the wrong column in the 3-column grid, placing content in the near-zero-width TOC column instead of the main content column. Fix: use `grid-column: main-start / toc-end` which uses CSS named grid lines from grid-template-areas, working regardless of column count. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 13d2a13 commit 2bdc073

File tree

2 files changed

+28
-12
lines changed

2 files changed

+28
-12
lines changed

apps/docs/app/[lang]/[[...slug]]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ export default async function Page(props: { params: Promise<{ slug?: string[]; l
233233
lang={lang}
234234
breadcrumb={breadcrumbs}
235235
/>
236-
<style>{`#nd-page { grid-column: 3 / span 2 !important; max-width: 1400px !important; }`}</style>
236+
<style>{`#nd-page { grid-column: main-start / toc-end !important; max-width: 1400px !important; }`}</style>
237237
<DocsPage
238238
toc={data.toc}
239239
breadcrumb={{

apps/docs/app/global.css

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -552,11 +552,10 @@ video {
552552
/* API Reference Pages — Mintlify-style overrides */
553553

554554
/* OpenAPI pages: span main + TOC grid columns for wide two-column layout.
555-
The grid has columns: spacer | sidebar | main | toc | spacer.
556-
By spanning columns 3-4, the article fills both main and toc areas,
557-
while the grid structure stays identical to non-OpenAPI pages (no jitter). */
555+
Use named grid lines from grid-template-areas so this works regardless
556+
of whether the grid has 3 columns (production) or 5 columns (local dev). */
558557
#nd-page:has(.api-page-header) {
559-
grid-column: 3 / span 2 !important;
558+
grid-column: main-start / toc-end !important;
560559
max-width: 1400px !important;
561560
}
562561

@@ -698,7 +697,9 @@ div.flex.flex-row.items-start.bg-fd-secondary.border.rounded-lg.text-xs {
698697
background-color: rgb(249 250 251) !important;
699698
border-color: rgb(229 231 235) !important;
700699
}
701-
html.dark #nd-page:has(.api-page-header) div.flex.flex-row.items-center.rounded-xl.border.not-prose {
700+
html.dark
701+
#nd-page:has(.api-page-header)
702+
div.flex.flex-row.items-center.rounded-xl.border.not-prose {
702703
--color-fd-card: rgb(24 24 27) !important;
703704
background-color: rgb(24 24 27) !important;
704705
border-color: rgb(63 63 70) !important;
@@ -795,7 +796,10 @@ html.dark
795796
padding: 0 !important;
796797
font-size: 0.8125rem !important;
797798
}
798-
html.dark #nd-page:has(.api-page-header) div.flex.flex-row.items-center.rounded-xl.border.not-prose code {
799+
html.dark
800+
#nd-page:has(.api-page-header)
801+
div.flex.flex-row.items-center.rounded-xl.border.not-prose
802+
code {
799803
color: rgb(229 231 235) !important;
800804
}
801805

@@ -1008,7 +1012,8 @@ html.dark
10081012
}
10091013

10101014
/* Required badge — order 3, red pill */
1011-
#nd-page:has(.api-page-header) .flex.flex-wrap.items-center.gap-3.not-prose:has(span.text-red-400)::after {
1015+
#nd-page:has(.api-page-header)
1016+
.flex.flex-wrap.items-center.gap-3.not-prose:has(span.text-red-400)::after {
10121017
content: "required";
10131018
order: 3;
10141019
display: inline-flex;
@@ -1030,7 +1035,9 @@ html.dark
10301035
}
10311036

10321037
/* Optional "?" indicator — hide it */
1033-
#nd-page:has(.api-page-header) span.font-medium.font-mono.text-fd-primary > span.text-fd-muted-foreground {
1038+
#nd-page:has(.api-page-header)
1039+
span.font-medium.font-mono.text-fd-primary
1040+
> span.text-fd-muted-foreground {
10341041
display: none;
10351042
}
10361043

@@ -1099,7 +1106,10 @@ html.dark
10991106
font-weight: 500;
11001107
font-family: var(--font-geist-sans), ui-sans-serif, system-ui, sans-serif;
11011108
}
1102-
html.dark #nd-page:has(.api-page-header) div.my-4 > .flex.flex-wrap.items-center.gap-3.not-prose::before {
1109+
html.dark
1110+
#nd-page:has(.api-page-header)
1111+
div.my-4
1112+
> .flex.flex-wrap.items-center.gap-3.not-prose::before {
11031113
background-color: rgb(51 51 56);
11041114
color: rgb(212 212 220);
11051115
}
@@ -1119,7 +1129,10 @@ html.dark #nd-page:has(.api-page-header) div.my-4 > .flex.flex-wrap.items-center
11191129
font-weight: 500;
11201130
font-family: var(--font-geist-sans), ui-sans-serif, system-ui, sans-serif;
11211131
}
1122-
html.dark #nd-page:has(.api-page-header) div.my-4 > .flex.flex-wrap.items-center.gap-3.not-prose::after {
1132+
html.dark
1133+
#nd-page:has(.api-page-header)
1134+
div.my-4
1135+
> .flex.flex-wrap.items-center.gap-3.not-prose::after {
11231136
background-color: rgb(153 27 27 / 0.3);
11241137
color: rgb(252 165 165);
11251138
}
@@ -1183,7 +1196,10 @@ html.dark #nd-page:has(.api-page-header) .text-sm.border-t {
11831196
font-family: var(--font-geist-sans), ui-sans-serif, system-ui, sans-serif;
11841197
}
11851198
html.dark #nd-page:has(.api-page-header) .flex.flex-wrap.items-center.gap-3.not-prose > button,
1186-
html.dark #nd-page:has(.api-page-header) .flex.flex-wrap.items-center.gap-3.not-prose > span:has(> button) {
1199+
html.dark
1200+
#nd-page:has(.api-page-header)
1201+
.flex.flex-wrap.items-center.gap-3.not-prose
1202+
> span:has(> button) {
11871203
background-color: rgb(51 51 56);
11881204
color: rgb(212 212 220);
11891205
}

0 commit comments

Comments
 (0)