Skip to content

Commit 3c948cc

Browse files
committed
stacking fix
1 parent bb81935 commit 3c948cc

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

components/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import SearchButton from './SearchButton'
99
const Header = () => {
1010
let headerClass = 'flex items-center w-full bg-white dark:bg-gray-950 justify-between py-10'
1111
if (siteMetadata.stickyNav) {
12-
headerClass += ' sticky top-0'
12+
headerClass += ' sticky top-0 z-50'
1313
}
1414

1515
return (

components/MobileNav.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ const MobileNav = () => {
5252
leave="ease-in duration-200"
5353
leaveFrom="opacity-100"
5454
leaveTo="opacity-0"
55+
unmount={false}
5556
>
56-
<div className="z-5 fixed inset-0 bg-black/25" />
57+
<div className="fixed inset-0 z-60 bg-black/25" />
5758
</Transition.Child>
5859

5960
<Transition.Child
@@ -66,7 +67,7 @@ const MobileNav = () => {
6667
leaveTo="translate-x-full opacity-0"
6768
unmount={false}
6869
>
69-
<Dialog.Panel className="fixed left-0 top-0 z-10 h-full w-full bg-white opacity-95 duration-300 dark:bg-gray-950 dark:opacity-[0.98]">
70+
<Dialog.Panel className="fixed left-0 top-0 z-70 h-full w-full bg-white opacity-95 duration-300 dark:bg-gray-950 dark:opacity-[0.98]">
7071
<nav
7172
ref={navRef}
7273
className="mt-8 flex h-full basis-0 flex-col items-start overflow-y-auto pl-12 pt-2 text-left"
@@ -84,7 +85,7 @@ const MobileNav = () => {
8485
</nav>
8586

8687
<button
87-
className="fixed right-4 top-7 z-20 h-16 w-16 p-4 text-gray-900 hover:text-primary-500 dark:text-gray-100 dark:hover:text-primary-400"
88+
className="fixed right-4 top-7 z-80 h-16 w-16 p-4 text-gray-900 hover:text-primary-500 dark:text-gray-100 dark:hover:text-primary-400"
8889
aria-label="Toggle Menu"
8990
onClick={onToggleNav}
9091
>

tailwind.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ module.exports = {
2828
primary: colors.pink,
2929
gray: colors.gray,
3030
},
31+
zIndex: {
32+
60: '60',
33+
70: '70',
34+
80: '80',
35+
},
3136
typography: ({ theme }) => ({
3237
DEFAULT: {
3338
css: {

0 commit comments

Comments
 (0)