Skip to content

Commit 94d9235

Browse files
committed
refactor(docs): drop dead grid placement, move footer stacking to the component
Review follow-ups. The divider's `grid-row`/`grid-column` stopped doing anything the moment it became `position: fixed` — a fixed box is out of grid layout entirely — so they and the comment explaining the grid span were describing positioning that no longer happens. Verified inert: the divider still computes to left 300px / width 1px / z-index 21 without them. The footer's stacking context also belongs on the footer, not in a global rule matching every desktop `footer` element, so it moves to the component as `relative z-[22]` with the reason in its TSDoc.
1 parent eac65c9 commit 94d9235

2 files changed

Lines changed: 12 additions & 16 deletions

File tree

apps/docs/app/global.css

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -380,17 +380,14 @@ aside#nd-sidebar [data-radix-scroll-area-viewport] {
380380
width: var(--fd-sidebar-width);
381381
}
382382

383-
/* Sidebar divider line — pinned for the same reason, and to stay glued to the
384-
sidebar's right edge. #nd-docs-layout is a CSS grid (see fumadocs' Container
385-
slot); the pseudo-element spans the full grid so it reads as decorative
386-
overlay rather than being auto-placed into a real content cell and skewing
387-
that cell's sizing. */
383+
/* Sidebar divider line — pinned for the same reason, and so it stays glued to
384+
the sidebar's right edge. Being fixed takes it out of #nd-docs-layout's grid
385+
entirely, so it needs no grid placement and cannot skew a content cell; its
386+
position comes from `left`/`top` alone. */
388387
#nd-docs-layout::before {
389388
content: "";
390389
display: block;
391390
position: fixed;
392-
grid-row: 1 / -1;
393-
grid-column: 1 / -1;
394391
top: 92px; /* below navbar */
395392
height: calc(100dvh - 92px);
396393
left: calc(var(--sidebar-offset) + var(--fd-sidebar-width));
@@ -400,14 +397,6 @@ aside#nd-sidebar [data-radix-scroll-area-viewport] {
400397
z-index: 21;
401398
}
402399

403-
/* The footer is opaque and now has to out-stack the pinned sidebar and its
404-
divider (z-index 20 and 21), so it slides over them at the end of the page
405-
rather than being drawn through. */
406-
footer {
407-
position: relative;
408-
z-index: 22;
409-
}
410-
411400
/* Hide fumadocs nav on desktop - we use custom navbar there */
412401
#nd-docs-layout > header {
413402
display: none !important;

apps/docs/components/footer/footer.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,16 @@ function FooterColumn({ title, items }: { title: string; items: FooterItem[] })
130130
)
131131
}
132132

133+
/**
134+
* Site footer.
135+
*
136+
* `relative z-[22]` stacks it above the docs sidebar (z-20) and that sidebar's
137+
* divider (z-21), both of which are pinned to the viewport, so the footer slides
138+
* over them at the end of the page instead of being drawn through.
139+
*/
133140
export function Footer() {
134141
return (
135-
<footer className='mt-[120px] w-full border-[var(--border)] border-t bg-[var(--bg)] max-sm:mt-16 max-lg:mt-[88px]'>
142+
<footer className='relative z-[22] mt-[120px] w-full border-[var(--border)] border-t bg-[var(--bg)] max-sm:mt-16 max-lg:mt-[88px]'>
136143
<div className='mx-auto w-full max-w-[1460px] px-20 pt-16 pb-16 max-sm:px-5 max-lg:px-8 max-lg:pt-12 max-lg:pb-12'>
137144
<nav
138145
aria-label='Footer navigation'

0 commit comments

Comments
 (0)