From 0babc9cdbf4910772a2862a5c694f08ab4100a33 Mon Sep 17 00:00:00 2001 From: Radiumcoders Date: Wed, 16 Sep 2026 20:37:42 +0530 Subject: [PATCH 1/3] feat: fill the docs chrome edge-to-edge and split panes with borders Co-authored-by: Cursor --- app/docs/[[...slug]]/page.tsx | 54 ++++++++--------- app/docs/template.tsx | 2 +- components/docs-shell.tsx | 110 ++++------------------------------ components/docs-sidebar.tsx | 3 +- components/docs-toc.tsx | 4 +- 5 files changed, 42 insertions(+), 131 deletions(-) diff --git a/app/docs/[[...slug]]/page.tsx b/app/docs/[[...slug]]/page.tsx index 68e9659..94b5f2f 100644 --- a/app/docs/[[...slug]]/page.tsx +++ b/app/docs/[[...slug]]/page.tsx @@ -26,36 +26,34 @@ export default async function Page(props: { const MDX = page.data.body return ( -
-
-
- +
+ +

+ {page.data.title} +

+ {page.data.description ? ( +

+ {page.data.description} +

+ ) : null} +
+ -

- {page.data.title} -

- {page.data.description ? ( -

- {page.data.description} -

- ) : null} -
- -
- -
- -
+
+ + + ) } diff --git a/app/docs/template.tsx b/app/docs/template.tsx index 42d9a20..e65af0e 100644 --- a/app/docs/template.tsx +++ b/app/docs/template.tsx @@ -11,7 +11,7 @@ import { ViewTransition } from "react" export default function DocsTemplate({ children }: { children: ReactNode }) { return ( -
{children}
+
{children}
) } diff --git a/components/docs-shell.tsx b/components/docs-shell.tsx index dc817b5..c9440c7 100644 --- a/components/docs-shell.tsx +++ b/components/docs-shell.tsx @@ -1,12 +1,6 @@ "use client" -import { - useEffect, - useId, - useRef, - type CSSProperties, - type ReactNode, -} from "react" +import { useEffect, useRef, type CSSProperties, type ReactNode } from "react" import Link from "next/link" import { usePathname } from "next/navigation" @@ -16,7 +10,6 @@ import { GithubStars } from "@/components/github-stars" import { Logo } from "@/components/logo" import { SearchTrigger } from "@/components/search-trigger" import { FrameworkProvider } from "@/lib/framework" -import { cn } from "@/lib/utils" import { Sidebar, SidebarContent, @@ -28,7 +21,7 @@ import { const sidebarTokens: CSSProperties = { "--sidebar": "var(--background)", "--sidebar-foreground": "var(--foreground)", - "--sidebar-border": "transparent", + "--sidebar-border": "var(--border)", "--sidebar-accent": "color-mix(in oklch, var(--foreground) 6%, transparent)", "--sidebar-accent-foreground": "var(--foreground)", "--sidebar-ring": "var(--ring)", @@ -46,80 +39,8 @@ type FolderNode = { type RootNode = { type?: "root"; name: ReactNode; children: TreeNode[] } type TreeNode = PageNode | SeparatorNode | FolderNode -const EDGE_BLUR_LAYERS = [ - { std: 5, opaque: 0, fade: 24 }, - { std: 3, opaque: 0, fade: 44 }, - { std: 2, opaque: 10, fade: 66 }, - { std: 1, opaque: 28, fade: 84 }, - { std: 0.5, opaque: 50, fade: 100 }, -] as const - -function DocsEdgeBlurDefs({ uid }: { uid: string }) { - return ( - - - {EDGE_BLUR_LAYERS.map((layer, i) => ( - - - - ))} - - - ) -} - -function WindowEdgeFade({ - edge, - uid, -}: { - edge: "top" | "bottom" - uid: string -}) { - const isTop = edge === "top" - const dir = isTop ? "to bottom" : "to top" - - return ( -
- {EDGE_BLUR_LAYERS.map((layer, i) => { - const mask = `linear-gradient(${dir}, black ${layer.opaque}%, transparent ${layer.fade}%)` - return ( -
- ) - })} -
- ) -} - /** - * Docs chrome: canvas sidebar + a real inset content window. - * The window is a flex column; the article scrolls inside it so the ring, - * corners, and shadow never have to be faked with overlays. + * Docs chrome: full-viewport panes split by borders. */ export function DocsShell({ tree, @@ -132,7 +53,6 @@ export function DocsShell({ }) { const pathname = usePathname() const scrollRef = useRef(null) - const blurUid = useId().replace(/:/g, "") useEffect(() => { scrollRef.current?.scrollTo({ top: 0 }) @@ -161,11 +81,9 @@ export function DocsShell({ - + - -
- {children} -
- - - -
+ +
+
+ {children} +
diff --git a/components/docs-sidebar.tsx b/components/docs-sidebar.tsx index d209174..4b0aa1d 100644 --- a/components/docs-sidebar.tsx +++ b/components/docs-sidebar.tsx @@ -271,11 +271,10 @@ export function DocsSidebar({ - + -
+