fixed table of contents sticking on all pages; more minor changes

This commit is contained in:
2025-07-14 14:36:05 +02:00
parent 777386a149
commit 6781bedcee
7 changed files with 33 additions and 23 deletions

View File

@@ -1,6 +1,12 @@
<script lang="ts">
import {onMount} from 'svelte';
let {
disableStickyScrolling,
}: {
disableStickyScrolling?: boolean;
} = $props();
let idCounter: number = 0;
let container: HTMLElement;
@@ -46,9 +52,15 @@
}
</script>
{#if disableStickyScrolling}
<div class="toc-container notched">
<ul class="toc-list" bind:this={container}></ul>
</div>
{:else}
<div class="toc-container notched sticky-toc">
<ul class="toc-list" bind:this={container}></ul>
</div>
{/if}
<style>
:global {
@@ -59,6 +71,9 @@
background-color: var(--color-background-highlight);
padding: 16px 0;
}
.sticky-toc {
position: sticky;
top: 20px;
}