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
12 changes: 5 additions & 7 deletions src/src/components/SiteBrand.astro
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,24 @@ const { iconOnly = false } = Astro.props;

<a
href={withBase('/')}
class="pv-brand flex items-center gap-2.5"
class="pv-brand flex min-w-0 items-center gap-2.5"
aria-label={`${SITE.fullName} — home`}
>
{
iconOnly ? (
iconOnly ?
<img
src={withBase('/branding/icon.svg')}
alt=""
width="28"
height="28"
class="h-7 w-7"
class="h-7 w-7 shrink-0"
/>
) : (
<img
: <img
src={withBase('/branding/logo-horizontal.svg')}
alt=""
width="120"
height="41"
class="h-9 w-auto"
/>
)
}
</a>
</a>
56 changes: 31 additions & 25 deletions src/src/components/SiteHeader.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@ import SiteNav from '~/components/SiteNav.astro';
import { SITE } from '~/lib/site';

interface Props {
/** True on documentation pages where the Starlight sidebar provides mobile nav. */
/** True on documentation pages where Starlight renders its own sidebar toggle
* (for the doc tree). The site-level nav toggle below is independent of that
* and always renders, since it links to top-level sections (Projects,
* Documentation, Releases, About) rather than the current doc's sidebar. */
hasSidebar: boolean;
}

const { hasSidebar } = Astro.props;
const { hasSidebar: _hasSidebar } = Astro.props;
const currentPath = Astro.url.pathname;
---

<div class="flex h-full w-full items-center justify-between gap-4">
<div class="relative flex h-full w-full items-center justify-between gap-4">
<div class="flex min-w-0 items-center gap-2.5">
<SiteBrand />
<span
Expand All @@ -35,34 +38,37 @@ const currentPath = Astro.url.pathname;
rel="noopener noreferrer"
target="_blank"
aria-label={`${SITE.orgName} on GitHub`}
class="rounded-md p-2 text-muted transition-colors hover:bg-surface hover:text-foreground"
class="hidden rounded-md p-2 text-muted transition-colors hover:bg-surface hover:text-foreground sm:inline-flex"
>
<svg
viewBox="0 0 16 16"
width="18"
height="18"
fill="currentColor"
aria-hidden="true"
>
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z" />
<svg viewBox="0 0 16 16" width="18" height="18" fill="currentColor" aria-hidden="true">
<path
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"
></path>
</svg>
</a>
</div>
</div>
</div>

{
hasSidebar ? null : (
<details class="group lg:hidden">
<summary class="flex cursor-pointer list-none items-center gap-2 rounded-md px-3 py-1.5 text-sm font-medium text-muted transition-colors hover:bg-surface hover:text-foreground">
<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
<path stroke-linecap="round" d="M4 6h16M4 12h16M4 18h16" />
<details class="lg:hidden">
<summary
class="flex cursor-pointer list-none items-center rounded-md p-2 text-muted transition-colors hover:bg-surface hover:text-foreground"
aria-label="Open site menu"
>
<svg
viewBox="0 0 24 24"
width="20"
height="20"
fill="none"
stroke="currentColor"
stroke-width="2"
aria-hidden="true"
>
<path stroke-linecap="round" d="M4 6h16M4 12h16M4 18h16"></path>
</svg>
Menu
</summary>
<div class="absolute inset-x-0 top-full z-50 border-b border-border bg-surface px-4 py-3 shadow-lg lg:hidden">
<div
class="absolute inset-x-0 top-full z-50 border-b border-border bg-surface px-4 py-3 shadow-lg lg:hidden"
>
<SiteNav currentPath={currentPath} vertical />
</div>
</details>
)
}
</div>
</div>
Loading
Loading