Skip to content

Commit 32adb4b

Browse files
committed
fix: add scroll-padding to accomodate for the sticky header height
1 parent 264b2a8 commit 32adb4b

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/components/Navbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export function Navbar({ children }: { children: React.ReactNode }) {
4848
const updateContainerHeight = () => {
4949
if (containerRef.current) {
5050
const height = containerRef.current.offsetHeight
51-
document.body.style.setProperty('--navbar-height', `${height}px`)
51+
document.documentElement.style.setProperty('--navbar-height', `${height}px`)
5252
}
5353
}
5454

src/routes/__root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ function HtmlWrapper({ children }: { children: React.ReactNode }) {
224224
) : null}
225225
<GamScripts />
226226
</head>
227-
<body style={{ '--navbar-height': '48px' } as any}>
227+
<body>
228228
<ToastProvider>
229229
<BackgroundGradient />
230230
<React.Suspense fallback={null}>

src/styles/app.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@
5353
::file-selector-button {
5454
border-color: var(--color-gray-200, currentcolor);
5555
}
56+
57+
:root {
58+
--navbar-height: 50px;
59+
scroll-padding-top: var(--navbar-height);
60+
}
5661
}
5762

5863
button {

0 commit comments

Comments
 (0)