diff --git a/src/lib/components/TocNav.svelte b/src/lib/components/TocNav.svelte index ad346280c8..c0e746e476 100644 --- a/src/lib/components/TocNav.svelte +++ b/src/lib/components/TocNav.svelte @@ -1,6 +1,7 @@ - + + {#if showToc} + + {/if} + + + diff --git a/src/lib/components/TocTree.svelte b/src/lib/components/TocTree.svelte index 3d0993897d..75431ed6a8 100644 --- a/src/lib/components/TocTree.svelte +++ b/src/lib/components/TocTree.svelte @@ -7,6 +7,8 @@ export let item: TableOfContentsElements['item']; export let level = 1; + export let showToc = true; + const { toc: { helpers: { isActive } @@ -22,6 +24,7 @@ class:is-selected={$isActive(heading.id)} href="#{heading.id}" use:melt={$item(heading.id)} + on:click|preventDefault={() => showToc = !showToc} > {@html heading.node.innerHTML} diff --git a/src/lib/utils/tutorials.ts b/src/lib/utils/tutorials.ts index 458df37cdb..e3a2d2965c 100644 --- a/src/lib/utils/tutorials.ts +++ b/src/lib/utils/tutorials.ts @@ -3,7 +3,7 @@ import type { Tutorial } from '$markdoc/layouts/Tutorial.svelte'; export function globToTutorial(data: { tutorials: Record; pathname: string }) { let isFound = false; - let difficulty, readtime; + let difficulty: string | undefined, readtime: string | undefined; return Object.entries(data.tutorials) .map(([filepath, tutorial]) => { diff --git a/src/markdoc/layouts/Policy.svelte b/src/markdoc/layouts/Policy.svelte index 814e88e50e..a65ec86cbb 100644 --- a/src/markdoc/layouts/Policy.svelte +++ b/src/markdoc/layouts/Policy.svelte @@ -72,23 +72,14 @@

{title}

- - + + +
-
+
@@ -107,7 +98,20 @@ opacity: 0; } - .toc-btn { - transition: translate 0.3s ease; + @media (max-width: 768px) { + .container { + padding-left: 0 !important; + padding-right: 0 !important; + } + + header { + padding-block-end: unset; + } + + header, + main { + padding-left: var(--spacing-5, 1.25rem); + padding-right: var(--spacing-5, 1.25rem); + } } diff --git a/src/routes/assets/+page.svelte b/src/routes/assets/+page.svelte index a65b909658..d3966068d9 100644 --- a/src/routes/assets/+page.svelte +++ b/src/routes/assets/+page.svelte @@ -35,6 +35,8 @@ selectedMap = selectedMap; }; }; + + let showToc = false; @@ -64,20 +66,12 @@

Brand assets

-
- -
-
+ + + +
+

Resources for presenting the Appwrite brand to maintain consistency @@ -628,4 +622,21 @@ } } } + + @media (max-width: 768px) { + .container { + padding-left: 0 !important; + padding-right: 0 !important; + } + + header { + padding-block-end: unset; + } + + header, + main { + padding-left: var(--spacing-5, 1.25rem); + padding-right: var(--spacing-5, 1.25rem); + } + }