From a7016d3f84b0fa70f5bbae29b8faa24d21b5e7bd Mon Sep 17 00:00:00 2001 From: Taesu <166604494+bytaesu@users.noreply.github.com> Date: Thu, 12 Mar 2026 21:44:37 +0900 Subject: [PATCH] docs: normalize docs topbar and toc row heights (#8566) --- landing/app/globals.css | 18 +++-- landing/components/docs/docs-sidebar.tsx | 75 ++++++++++++------- .../landing/staggered-nav-files.tsx | 26 +++---- 3 files changed, 71 insertions(+), 48 deletions(-) diff --git a/landing/app/globals.css b/landing/app/globals.css index f57e028190..80fad3129e 100644 --- a/landing/app/globals.css +++ b/landing/app/globals.css @@ -386,6 +386,7 @@ --scrollbar-thumb-hover: var(--ring); --scrollbar-track: transparent; --radius: 0.2rem; + --landing-topbar-height: 48px; --fd-nav-height: 56px; --fd-banner-height: 0px; --fd-tocnav-height: 0px; @@ -409,6 +410,12 @@ --spacing: 0.25rem; } +@media (min-width: 64rem) { + :root { + --landing-topbar-height: 44px; + } +} + .dark { --background: hsl(0 0% 0%); --foreground: oklch(0.985 0.001 106.423); @@ -629,10 +636,10 @@ html:not([data-anchor-scrolling]) { --fd-layout-width: 100vw; --fd-layout-offset: 0px; --fd-page-width: 900px; - --fd-banner-height: 44px; + --fd-banner-height: var(--landing-topbar-height); --landing-left-pane-width: min(22vw, 300px); --staggered-nav-cta-width: 128px; - padding-top: 44px; + padding-top: var(--landing-topbar-height); } @media (min-width: 64rem) { @@ -641,7 +648,6 @@ html:not([data-anchor-scrolling]) { calc(100vw - var(--landing-left-pane-width)), 1200px ); - --fd-header-height: -1px; padding-inline-start: var(--landing-left-pane-width); } @@ -649,7 +655,7 @@ html:not([data-anchor-scrolling]) { content: ""; position: fixed; inset-block-start: 0; - height: 44px; + height: var(--landing-topbar-height); inset-inline-start: calc(var(--landing-left-pane-width) - 1px); width: 1px; background: var(--color-border); @@ -698,7 +704,7 @@ html:not([data-anchor-scrolling]) { /* Blog layout: matches docs pattern with narrow left pane + TOC sidebar */ .blog-layout { - padding-top: 44px; + padding-top: var(--landing-topbar-height); } @media (min-width: 64rem) { @@ -710,7 +716,7 @@ html:not([data-anchor-scrolling]) { content: ""; position: fixed; inset-block-start: 0; - height: 44px; + height: var(--landing-topbar-height); inset-inline-start: calc(var(--landing-left-pane-width) - 1px); width: 1px; background: var(--color-border); diff --git a/landing/components/docs/docs-sidebar.tsx b/landing/components/docs/docs-sidebar.tsx index 96a645ec6d..90120a9f62 100644 --- a/landing/components/docs/docs-sidebar.tsx +++ b/landing/components/docs/docs-sidebar.tsx @@ -1,14 +1,15 @@ "use client"; import { AnimatePresence, MotionConfig, motion } from "framer-motion"; -import { ChevronDownIcon, GitBranch, Search, Sparkles } from "lucide-react"; +import { useSearchContext } from "fumadocs-ui/contexts/search"; +import { ChevronDownIcon, GitBranch, Search } from "lucide-react"; import Link from "next/link"; import { usePathname, useRouter, useSearchParams } from "next/navigation"; import type { ReactNode } from "react"; import { useEffect, useRef, useState } from "react"; -import { useCommandMenu } from "@/components/command-menu"; import type { ListItem } from "@/components/sidebar-content"; import { contents } from "@/components/sidebar-content"; +import { ThemeToggle } from "@/components/theme-toggle"; import { Badge } from "@/components/ui/badge"; import { cn } from "@/lib/utils"; @@ -18,7 +19,7 @@ export function DocsSidebar() { const pathname = usePathname(); const searchParams = useSearchParams(); const branch = searchParams.get("branch"); - const { setOpen, openAI } = useCommandMenu(); + const { setOpenSearch } = useSearchContext(); const [currentOpen, setCurrentOpen] = useState(0); const navRef = useRef(null); @@ -70,37 +71,31 @@ export function DocsSidebar() { initial={{ x: -24, opacity: 0 }} animate={{ x: 0, opacity: 1 }} transition={{ duration: 0.28, ease: "easeOut" }} - className="fixed left-0 top-[44px] bottom-0 w-[22vw] max-w-[300px] hidden lg:flex flex-col z-30 bg-background border-r border-foreground/5 transition-[width] duration-300 ease-out" + className="fixed left-0 top-(--landing-topbar-height) bottom-0 w-[22vw] max-w-[300px] hidden lg:flex flex-col z-30 bg-background border-r border-foreground/5 transition-[width] duration-300 ease-out" > {/* Branch switcher */} {/* Scrollable navigation area */} + + {/* Footer: GitHub + Theme Toggle */} +
+ + + + + +
+ +
+
); } @@ -192,15 +209,15 @@ function BranchSwitcher() { }; return ( -
+