Skip to content

Commit b2fffaa

Browse files
committed
fix dark mode for mobile
1 parent 2dc3e04 commit b2fffaa

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

src/components/header.jsx

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,13 @@ const Header = () => {
104104
<Collapse in={mobileMenuOpen && isMobile}>
105105
<Box
106106
sx={{
107-
bgcolor: 'primary.dark',
107+
bgcolor:
108+
theme.palette.mode === 'dark'
109+
? 'background.paper'
110+
: 'primary.dark',
108111
borderTop: 1,
109-
borderColor: 'primary.light',
112+
borderColor:
113+
theme.palette.mode === 'dark' ? 'divider' : 'primary.light',
110114
}}
111115
>
112116
<Stack spacing={0}>
@@ -122,14 +126,26 @@ const Header = () => {
122126
px: 3,
123127
py: 1.5,
124128
borderRadius: 0,
125-
color: 'white !important',
129+
color:
130+
theme.palette.mode === 'dark'
131+
? 'text.primary'
132+
: 'white !important',
126133
textDecoration: 'none !important',
127134
'&:hover': {
128-
backgroundColor: 'rgba(255, 255, 255, 0.1)',
129-
color: 'white !important',
135+
backgroundColor:
136+
theme.palette.mode === 'dark'
137+
? 'action.hover'
138+
: 'rgba(255, 255, 255, 0.1)',
139+
color:
140+
theme.palette.mode === 'dark'
141+
? 'text.primary'
142+
: 'white !important',
130143
},
131144
'&:visited': {
132-
color: 'white !important',
145+
color:
146+
theme.palette.mode === 'dark'
147+
? 'text.primary'
148+
: 'white !important',
133149
},
134150
fontSize: '1rem',
135151
fontWeight: 500,

0 commit comments

Comments
 (0)