fix: use CSS variable for TOC sticky offset instead of hardcoded pixels
This commit is contained in:
@@ -73,6 +73,7 @@
|
|||||||
scroll-padding-top: 96px;
|
scroll-padding-top: 96px;
|
||||||
}
|
}
|
||||||
body {
|
body {
|
||||||
|
--header-height: 56px;
|
||||||
font-family: var(--font-serif);
|
font-family: var(--font-serif);
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export function TableOfContents() {
|
|||||||
if (headings.length === 0) return null;
|
if (headings.length === 0) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<nav className="lg:sticky lg:top-[72px]">
|
<nav className="lg:sticky lg:top-[var(--header-height)]">
|
||||||
<h4 className="font-sans text-xs font-semibold uppercase tracking-wider text-ink-soft mb-3">
|
<h4 className="font-sans text-xs font-semibold uppercase tracking-wider text-ink-soft mb-3">
|
||||||
On this page
|
On this page
|
||||||
</h4>
|
</h4>
|
||||||
|
|||||||
Reference in New Issue
Block a user