Skip to content

Commit 0029f32

Browse files
committed
Fix docs anchor scroll offset
1 parent 13f4d55 commit 0029f32

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

src/components/LibraryLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1393,7 +1393,7 @@ export function LibraryLayout({
13931393
className={`
13941394
md:min-h-[calc(100dvh-var(--navbar-height))]
13951395
flex flex-col
1396-
w-full transition-all duration-300 [--docs-tabs-height:41px] min-[1120px]:[--docs-tabs-height:42px]
1396+
w-full transition-all duration-300
13971397
[overflow-x:clip]`}
13981398
>
13991399
{smallMenu}

src/styles/app.css

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,21 @@ html.theme-switching *::after {
118118

119119
:root {
120120
--navbar-height: 52px;
121-
scroll-padding-top: var(--navbar-height);
121+
--docs-tabs-height: 0px;
122+
--anchor-scroll-padding-top: calc(
123+
var(--navbar-height) + var(--docs-tabs-height)
124+
);
125+
scroll-padding-top: var(--anchor-scroll-padding-top);
126+
}
127+
128+
:root:has([data-docs-layout]) {
129+
--docs-tabs-height: 41px;
130+
}
131+
132+
@media (min-width: 1120px) {
133+
:root:has([data-docs-layout]) {
134+
--docs-tabs-height: 42px;
135+
}
122136
}
123137
}
124138

0 commit comments

Comments
 (0)