From 849f7a6210d70ffbc16600141b32ae6297f230c9 Mon Sep 17 00:00:00 2001 From: kallelongjuhani Date: Thu, 29 Jan 2026 09:57:27 +0200 Subject: [PATCH] feat[docs]: mobile navigation Add full mobile navigation for `docs`. Remove `fixed` from `Header`. --- docs/src/lib/components/Header.svelte | 25 +++---- docs/src/lib/components/Navigation.svelte | 72 +++++++------------ docs/src/lib/components/NavigationItem.svelte | 48 +++++++++++++ .../src/lib/components/TableOfContents.svelte | 3 +- docs/src/lib/consts.ts | 2 + docs/src/lib/layouts/MdLayout.svelte | 2 +- docs/src/routes/(content)/+layout.svelte | 4 +- docs/src/routes/+layout.svelte | 31 ++++++-- 8 files changed, 112 insertions(+), 75 deletions(-) create mode 100644 docs/src/lib/components/NavigationItem.svelte diff --git a/docs/src/lib/components/Header.svelte b/docs/src/lib/components/Header.svelte index c5a0972e4..e30945a35 100644 --- a/docs/src/lib/components/Header.svelte +++ b/docs/src/lib/components/Header.svelte @@ -5,13 +5,14 @@ import { getFirstChild } from '$lib/utils/navigation'; import GithubIcon from '$lib/components/GithubIcon.svelte'; import { OpenVAALogo } from '$lib/components/openVAALogo'; + import { DRAWER_ID } from '../consts'; function isActiveSection(section: NavigationSection): boolean { return page.url.pathname.startsWith(section.route); } -
+
diff --git a/docs/src/lib/components/Navigation.svelte b/docs/src/lib/components/Navigation.svelte index 6c5ffe8ef..00f09a3a1 100644 --- a/docs/src/lib/components/Navigation.svelte +++ b/docs/src/lib/components/Navigation.svelte @@ -1,56 +1,34 @@ -{#if activeSection} - diff --git a/docs/src/lib/components/NavigationItem.svelte b/docs/src/lib/components/NavigationItem.svelte new file mode 100644 index 000000000..911b86f43 --- /dev/null +++ b/docs/src/lib/components/NavigationItem.svelte @@ -0,0 +1,48 @@ + + +{#if hasChildren(item)} +
  • +
    + + {item.title} + +
      + {#each item.children as child} + + {/each} +
    +
    +
  • +{:else} +
  • + + {item.title} + +
  • +{/if} + + diff --git a/docs/src/lib/components/TableOfContents.svelte b/docs/src/lib/components/TableOfContents.svelte index 4ac9f8a31..f56e09382 100644 --- a/docs/src/lib/components/TableOfContents.svelte +++ b/docs/src/lib/components/TableOfContents.svelte @@ -74,7 +74,7 @@ {#if filteredHeadings.length > 0} -