Skip to content

Commit b7d26dc

Browse files
committed
πŸ› Make sticky work for ToC
Sticky for the container, not the whole column
1 parent 3f0df5e commit b7d26dc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

β€Žpackages/docs/src/lib/components/TableOfContents.svelteβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</script>
1212

1313
{#if filteredHeadings.length > 0}
14-
<nav>
14+
<nav class="sticky top-0">
1515
<h2 class="pb-2 font-semibold">On This Page</h2>
1616
<ul class={navStyles}>
1717
{#each filteredHeadings as heading (heading.id)}

β€Žpackages/docs/src/routes/[...slug]/+page.svelteβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<data.page.default />
2828
</div>
2929
{#if headings}
30-
<div class="hidden sm:block sm:sticky top-0">
30+
<div class="hidden sm:block">
3131
<TableOfContents {headings} />
3232
</div>
3333
{/if}

0 commit comments

Comments
Β (0)