From 1bf36a1bf25b646dc4b8dfe541f5cf01ad9285b7 Mon Sep 17 00:00:00 2001 From: Ryan Gossiaux Date: Mon, 7 Mar 2022 12:08:17 -0800 Subject: [PATCH] docs: Tweak TOC rootMargin parameter To take into account the top header. --- src/routes/docs/_TableOfContents.svelte | 3 ++- src/routes/docs/__layout.svelte | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/routes/docs/_TableOfContents.svelte b/src/routes/docs/_TableOfContents.svelte index e0e50c2..0f70504 100644 --- a/src/routes/docs/_TableOfContents.svelte +++ b/src/routes/docs/_TableOfContents.svelte @@ -4,6 +4,7 @@ import TocItems, { type TocItem } from "./_TocItems.svelte"; export let el: HTMLElement | null; + export let rootMargin = "0% 0% -80% 0%"; let runWithCleanup = createRunWithCleanup(); let activeId: string | undefined; @@ -55,7 +56,7 @@ } }); }, - { rootMargin: `0% 0% -80% 0%` } + { rootMargin } ); }); diff --git a/src/routes/docs/__layout.svelte b/src/routes/docs/__layout.svelte index dbdb86f..1842ad8 100644 --- a/src/routes/docs/__layout.svelte +++ b/src/routes/docs/__layout.svelte @@ -28,7 +28,7 @@ class="sticky top-0 pt-20 pb-4 -mt-[61px] max-h-screen overflow-y-auto" > {#key $page} - + {/key}