diff --git a/www/components/DocsSidebar.tsx b/www/components/DocsSidebar.tsx index 2bfe528d..47eb988e 100644 --- a/www/components/DocsSidebar.tsx +++ b/www/components/DocsSidebar.tsx @@ -52,7 +52,7 @@ export default function DocsSidebar( ) - : } + : }
-
    +
      {CATEGORIES[props.selectedVersion].map((category) => ( ))} @@ -71,7 +71,7 @@ export default function DocsSidebar( } const link = "text(gray-900 hover:gray-600)"; -const linkActive = "text(green-600 hover:green-500)"; +const linkActive = "text(green-600 hover:green-500) font-bold"; export function SidebarCategory(props: { path: string; @@ -83,9 +83,11 @@ export function SidebarCategory(props: { return (
    1. - {title} + + {title} + {entries.length > 0 && ( -
        +
          {entries.map((entry) => ( ))} @@ -101,10 +103,12 @@ export function SidebarEntry(props: { }) { const { title, href } = props.entry; - const innerLink = `${href == props.path ? linkActive : link} font-normal`; + const innerLink = `${ + href == props.path ? linkActive : link + } transition-colors hover:text-green-500 font-normal`; return ( -
        1. +
        2. {title}
        3. ); diff --git a/www/components/Header.tsx b/www/components/Header.tsx index eac27285..7c4874cd 100644 --- a/www/components/Header.tsx +++ b/www/components/Header.tsx @@ -1,21 +1,23 @@ import DocsTitle from "./DocsTitle.tsx"; import NavigationBar from "./NavigationBar.tsx"; +import SearchButton from "../islands/SearchButton.tsx"; export default function Header(props: { title: string; active: string }) { const isHome = props.active == "/"; + const isDocs = props.active.startsWith("/docs"); return (
          - {!isHome && - ( -
          - - -
          - )} + {!isHome && ( +
          + + +
          + )} + {isDocs &&
          @@ -26,12 +28,7 @@ export default function Header(props: { title: string; active: string }) { function Logo() { return ( - Fresh logo + Fresh logo ); } diff --git a/www/islands/SearchButton.tsx b/www/islands/SearchButton.tsx index 71a3cee9..a4c7084b 100644 --- a/www/islands/SearchButton.tsx +++ b/www/islands/SearchButton.tsx @@ -2,7 +2,7 @@ import { Head } from "$fresh/runtime.ts"; import { useEffect, useRef } from "preact/hooks"; import docsearch from "https://esm.sh/@docsearch/js@3"; -export default function SearchButton() { +export default function SearchButton(props: { class?: string }) { const ref = useRef(null); useEffect(() => { if (ref.current) { @@ -22,7 +22,7 @@ export default function SearchButton() { href="/docsearch.css" /> -
          +
          ); } diff --git a/www/routes/docs/[...slug].tsx b/www/routes/docs/[...slug].tsx index 020163e5..10ebf029 100644 --- a/www/routes/docs/[...slug].tsx +++ b/www/routes/docs/[...slug].tsx @@ -168,7 +168,7 @@ function Main(props: { path: string; page: Page }) { return (
          -
          +
          -
          +
          @@ -235,7 +233,7 @@ function MobileSidebar(props: { path: string; page: Page }) { function DesktopSidebar(props: { path: string; page: Page }) { return ( -