docs: Tweak TOC rootMargin parameter
To take into account the top header.
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
import TocItems, { type TocItem } from "./_TocItems.svelte";
|
import TocItems, { type TocItem } from "./_TocItems.svelte";
|
||||||
|
|
||||||
export let el: HTMLElement | null;
|
export let el: HTMLElement | null;
|
||||||
|
export let rootMargin = "0% 0% -80% 0%";
|
||||||
|
|
||||||
let runWithCleanup = createRunWithCleanup();
|
let runWithCleanup = createRunWithCleanup();
|
||||||
let activeId: string | undefined;
|
let activeId: string | undefined;
|
||||||
@@ -55,7 +56,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
{ rootMargin: `0% 0% -80% 0%` }
|
{ rootMargin }
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
class="sticky top-0 pt-20 pb-4 -mt-[61px] max-h-screen overflow-y-auto"
|
class="sticky top-0 pt-20 pb-4 -mt-[61px] max-h-screen overflow-y-auto"
|
||||||
>
|
>
|
||||||
{#key $page}
|
{#key $page}
|
||||||
<TableOfContents {el} />
|
<TableOfContents {el} rootMargin="-61px 0% -85% 0%" />
|
||||||
{/key}
|
{/key}
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user