diff options
author | ζηδΈ° | 2023-05-17 16:33:36 +0800 |
---|---|---|
committer | GitHub | 2023-05-17 10:33:36 +0200 |
commit | 608f34cbbe485c39730f33828971397f9c8a3534 (patch) | |
tree | 24f65e2f4a77203200d85cd794bc8312534ba1c0 | |
parent | 5b6cccb7f9ee5810c75fbbb45496e2a1d022f7dd (diff) | |
download | IT.starlight-608f34cbbe485c39730f33828971397f9c8a3534.tar.gz IT.starlight-608f34cbbe485c39730f33828971397f9c8a3534.tar.bz2 IT.starlight-608f34cbbe485c39730f33828971397f9c8a3534.zip |
Fix ToC headingsObserver rootMargin (#61)
-rw-r--r-- | .changeset/fifty-adults-accept.md | 5 | ||||
-rw-r--r-- | packages/starlight/components/TableOfContents/starlight-toc.ts | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/.changeset/fifty-adults-accept.md b/.changeset/fifty-adults-accept.md new file mode 100644 index 00000000..f5624d05 --- /dev/null +++ b/.changeset/fifty-adults-accept.md @@ -0,0 +1,5 @@ +--- +"@astrojs/starlight": patch +--- + +Fix toc headingsObserver rootMargin diff --git a/packages/starlight/components/TableOfContents/starlight-toc.ts b/packages/starlight/components/TableOfContents/starlight-toc.ts index 450fad08..fd194450 100644 --- a/packages/starlight/components/TableOfContents/starlight-toc.ts +++ b/packages/starlight/components/TableOfContents/starlight-toc.ts @@ -69,7 +69,7 @@ export class StarlightTOC extends HTMLElement { }; const headingsObserver = new IntersectionObserver(setCurrent, { - rootMargin: '5% 0% -85%', + rootMargin: '-10% 0% -85%', }); // Observe elements with an `id` (most likely headings) and their siblings. |