File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import * as Search from './search'
5
5
import NavDrawer from './nav-drawer'
6
6
import Link from './link'
7
7
import useSearch from '../hooks/use-search'
8
- import { HEADER_HEIGHT , HEADER_BAR } from '../constants'
8
+ import { HEADER_HEIGHT , HEADER_BAR , Z_INDEX } from '../constants'
9
9
import headerNavItems from '../../content/header-nav.yml'
10
10
import { DarkTheme } from '../theme'
11
11
import SiteTitle from './site-title'
@@ -19,7 +19,7 @@ function Header() {
19
19
const search = useSearch ( )
20
20
21
21
return (
22
- < DarkTheme sx = { { top : 0 , position : 'sticky' , zIndex : 1 } } >
22
+ < DarkTheme sx = { { top : 0 , position : 'sticky' , zIndex : Z_INDEX . HEADER } } >
23
23
< NpmHeaderBar />
24
24
< Box
25
25
as = "header"
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import {AnimatePresence, motion} from 'framer-motion'
5
5
import { FocusOn } from 'react-focus-on'
6
6
import TextInput from './text-input'
7
7
import useSiteMetadata from '../hooks/use-site-metadata'
8
- import { HEADER_BAR , HEADER_HEIGHT } from '../constants'
8
+ import { HEADER_BAR , HEADER_HEIGHT , Z_INDEX } from '../constants'
9
9
import { LightTheme } from '../theme'
10
10
import { LinkNoUnderline } from './link'
11
11
import * as getNav from '../util/get-nav'
@@ -132,7 +132,7 @@ export const Mobile = ({
132
132
left : 0 ,
133
133
right : 0 ,
134
134
bottom : 0 ,
135
- zIndex : 1 ,
135
+ zIndex : Z_INDEX . SEARCH_OVERLAY ,
136
136
} }
137
137
>
138
138
< Box
@@ -169,7 +169,7 @@ export const Mobile = ({
169
169
borderColor : 'border.muted' ,
170
170
position : 'relative' ,
171
171
bg : 'canvas.default' ,
172
- zIndex : 9999 ,
172
+ zIndex : Z_INDEX . SEARCH_OVERLAY + 1 ,
173
173
} }
174
174
>
175
175
< motion . div
Original file line number Diff line number Diff line change @@ -11,3 +11,8 @@ export const SKIP_TO_CONTENT_ID = 'skip-to-content'
11
11
export const SKIP_TO_SEARCH_ID = 'search-box-input'
12
12
13
13
export const CLI_PATH = '/cli'
14
+
15
+ export const Z_INDEX = {
16
+ HEADER : 10 ,
17
+ SEARCH_OVERLAY : 25
18
+ }
You can’t perform that action at this time.
0 commit comments