Skip to content

Commit 60a951c

Browse files
docs(layout): improve sidebar spacing and fade effects
Adjust sidebar container height calculation to add more bottom margin. Increase fade gradient height and add via-stop for more pronounced effect. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
1 parent 2ddcef3 commit 60a951c

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

web/src/app/docs/layout.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export default function DocsLayout({
1212
children,
1313
}: {
1414
children: React.ReactNode
15-
}) { const pathname = usePathname()
15+
}) {
16+
const pathname = usePathname()
1617
const [open, setOpen] = useState(false)
1718
const [showTopFade, setShowTopFade] = useState(false)
1819
const [showBottomFade, setShowBottomFade] = useState(false)
@@ -49,27 +50,29 @@ export default function DocsLayout({
4950
className="w-64 sticky z-40"
5051
style={{
5152
top: `${stickyTop}px`,
52-
height: `calc(100vh - ${stickyTop}px - 1rem)`,
53+
height: `calc(100vh - ${stickyTop}px - 3rem)`,
5354
}}
5455
>
5556
{/* Dynamic gradient fade indicators */}
5657
{showTopFade && (
57-
<div className="absolute top-0 left-0 right-0 h-6 bg-gradient-to-b from-background to-transparent pointer-events-none z-10 rounded-t-lg transition-opacity duration-200" />
58+
<div className="absolute top-0 left-0 right-0 h-12 bg-gradient-to-b from-background via-background/60 to-transparent pointer-events-none z-10 rounded-t-lg transition-opacity duration-200" />
5859
)}
5960
{showBottomFade && (
60-
<div className="absolute bottom-0 left-0 right-0 h-6 bg-gradient-to-t from-background to-transparent pointer-events-none z-10 rounded-b-lg transition-opacity duration-200" />
61+
<div className="absolute bottom-0 left-0 right-0 h-12 bg-gradient-to-t from-background via-background/60 to-transparent pointer-events-none z-10 rounded-b-lg transition-opacity duration-200" />
6162
)}
6263

6364
{/* Enhanced scrollable container */}
6465
<div
6566
ref={sidebarRef}
66-
className="relative h-full overflow-y-auto pr-4 pl-4 pt-2 pb-6 custom-scrollbar bg-background/95 backdrop-blur-sm rounded-lg border border-border/50 shadow-lg"
67+
className="relative h-full overflow-y-auto pr-4 pl-4 pt-4 pb-6 custom-scrollbar bg-background/95 backdrop-blur-sm rounded-lg border border-border/50 shadow-lg"
6768
>
6869
<DocSidebar className="" onNavigate={() => setOpen(false)} />
6970
</div>
7071
</div>
7172
</div>
72-
<main className="flex-1 mx-auto pb-36 md:px-8 min-w-0 pt-8">{children}</main>
73+
<main className="flex-1 mx-auto pb-36 md:px-8 min-w-0 pt-8">
74+
{children}
75+
</main>
7376
</div>
7477
<div className="flex items-center lg:hidden sticky bottom-0 z-50 bg-background/80 backdrop-blur-sm container p-4 rounded-t-lg border-t">
7578
<Sheet

0 commit comments

Comments
 (0)