Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 23 additions & 9 deletions apps/docs/app/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -362,18 +362,32 @@ aside#nd-sidebar [data-radix-scroll-area-viewport] {
min-height: var(--fd-docs-height) !important;
}

/* Sidebar divider line — sticky within the docs layout box, so it ends where
the layout does instead of bleeding into (or past) the footer below it.
#nd-docs-layout is a CSS grid (see fumadocs' Container slot); a sticky
pseudo-element stays in normal flow, so without an explicit grid-area it
gets auto-placed into a real content cell and skews that cell's sizing.
Spanning the full grid keeps it purely decorative/overlaid instead. */
/* Pin the sidebar to the viewport instead of letting fumadocs' `sticky` do it.
A sticky box is bottom-limited by its containing block, and #nd-docs-layout
ends ~660px above the document bottom because the site footer is a sibling
of the layout, not a grid child. So across the whole footer the sidebar gets
pushed upward — and any content-height change while the reader is in that
zone (expanding an FAQ row, say) makes it visibly jump. A fixed box ignores
both the container's end and the document's height, so neither happens.

Safe because the grid columns are explicit (`0px 300px 1fr 268px 0px`), so
removing the placeholder from flow leaves its track intact. `left`/`width`
are restated because a fixed box no longer derives them from its grid cell,
and `top`/`height` already come from fumadocs' own utility classes. */
[data-sidebar-placeholder] {
position: fixed !important;
left: var(--sidebar-offset);
width: var(--fd-sidebar-width);
}
Comment thread
waleedlatif1 marked this conversation as resolved.

/* Sidebar divider line — pinned for the same reason, and so it stays glued to
the sidebar's right edge. Being fixed takes it out of #nd-docs-layout's grid
entirely, so it needs no grid placement and cannot skew a content cell; its
position comes from `left`/`top` alone. */
#nd-docs-layout::before {
content: "";
display: block;
position: sticky;
grid-row: 1 / -1;
grid-column: 1 / -1;
position: fixed;
top: 92px; /* below navbar */
height: calc(100dvh - 92px);
left: calc(var(--sidebar-offset) + var(--fd-sidebar-width));
Expand Down
9 changes: 8 additions & 1 deletion apps/docs/components/footer/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,16 @@ function FooterColumn({ title, items }: { title: string; items: FooterItem[] })
)
}

/**
* Site footer.
*
* `relative z-[22]` stacks it above the docs sidebar (z-20) and that sidebar's
* divider (z-21), both of which are pinned to the viewport, so the footer slides
* over them at the end of the page instead of being drawn through.
*/
export function Footer() {
return (
<footer className='mt-[120px] w-full border-[var(--border)] border-t bg-[var(--bg)] max-sm:mt-16 max-lg:mt-[88px]'>
<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]'>
<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'>
<nav
aria-label='Footer navigation'
Expand Down
Loading