@@ -28,6 +28,10 @@ export function Navbar({ links, year }: NavbarProps): ReactElement {
28
28
setMobileDrawerOpen ( false )
29
29
} , [ pathname ] )
30
30
31
+ useEffect ( ( ) => {
32
+ document . body . style . overflow = mobileDrawerOpen ? "hidden" : "auto"
33
+ } , [ mobileDrawerOpen ] )
34
+
31
35
return (
32
36
< >
33
37
< div
@@ -36,23 +40,18 @@ export function Navbar({ links, year }: NavbarProps): ReactElement {
36
40
mobileDrawerOpen ? "static" : "absolute" ,
37
41
) }
38
42
/>
39
- < div
40
- // placeholder: the colors here on `before` must match the ones on Hero `before` strip
41
- className = "absolute h-[calc(var(--navbar-h)+1px)] w-full bg-pri-base before:absolute before:top-0 before:h-[calc(var(--navbar-h)+1px)] before:w-full before:bg-white/30 dark:bg-pri-darker dark:before:bg-black/40"
42
- />
43
+ < NavbarPlaceholder className = "bg-pri-base before:bg-white/30 dark:bg-pri-darker dark:before:bg-blk/40" />
43
44
< header
44
45
className = { clsx (
45
- "gql-all-anchors-focusable top-0 z-10 w-full border-b border-black/60 font-mono text-neu-900 antialiased dark:border-white/80" ,
46
- mobileDrawerOpen
47
- ? "fixed border-neu-900 dark:border-white"
48
- : "sticky" ,
46
+ "gql-all-anchors-focusable sticky top-0 z-10 w-full border-b border-blk/60 font-mono text-neu-900 antialiased dark:border-white/80" ,
47
+ mobileDrawerOpen && "!border-neu-900 dark:!border-white" ,
49
48
) }
50
49
>
51
50
< BackdropBlur />
52
51
< div className = "flex h-[var(--navbar-h)] items-center justify-between gap-5 px-4 lg:px-10" >
53
52
< GraphQLConfLogoLink year = { year } />
54
53
55
- < div className = "mr-auto flex h-full flex-col justify-center whitespace-pre border-x border-black /60 px-4 typography-menu dark:border-white/80 max-xl:hidden" >
54
+ < div className = "mr-auto flex h-full flex-col justify-center whitespace-pre border-x border-blk /60 px-4 typography-menu dark:border-white/80 max-xl:hidden" >
56
55
< p className = "flex items-center gap-2 text-sm" >
57
56
< time dateTime = "2025-09-08" > September 08</ time >
58
57
< span > -</ span >
@@ -65,8 +64,9 @@ export function Navbar({ links, year }: NavbarProps): ReactElement {
65
64
66
65
{ mobileDrawerOpen && (
67
66
< div
67
+ // menu overlay
68
68
onClick = { handleDrawerClick }
69
- className = "fixed inset-0 top-[calc(var(--navbar-h)+1px)] z-10 bg-neu-0 /40 backdrop-blur-[6.4px]"
69
+ className = "fixed inset-0 top-[calc(var(--navbar-h)+1px)] z-10 bg-white /40 backdrop-blur-[6.4px] dark:bg-blk/30 "
70
70
/>
71
71
) }
72
72
@@ -131,3 +131,19 @@ function BackdropBlur() {
131
131
/>
132
132
)
133
133
}
134
+
135
+ export function NavbarPlaceholder ( {
136
+ className,
137
+ ...rest
138
+ } : React . HTMLAttributes < HTMLDivElement > ) {
139
+ return (
140
+ < div
141
+ // placeholder: the colors here on `before` must match the ones on Hero `before` strip
142
+ className = { clsx (
143
+ "absolute h-[calc(var(--navbar-h)+1px)] w-full before:absolute before:top-0 before:h-[calc(var(--navbar-h)+1px)] before:w-full" ,
144
+ className ,
145
+ ) }
146
+ { ...rest }
147
+ />
148
+ )
149
+ }
0 commit comments