File tree Expand file tree Collapse file tree 4 files changed +38
-19
lines changed Expand file tree Collapse file tree 4 files changed +38
-19
lines changed Original file line number Diff line number Diff line change @@ -94,9 +94,11 @@ function App() {
94
94
} ;
95
95
96
96
useEffect ( ( ) => {
97
- setTheme ( getWithExpiry ( SYSTEM_THEME_KEY ) ) ;
97
+ const theme = getWithExpiry ( SYSTEM_THEME_KEY ) ;
98
+ setTheme ( theme ) ;
98
99
setAlgoTheme ( getWithExpiry ( ALGO_THEME_KEY ) ) ;
99
- } ) ;
100
+ document . documentElement . setAttribute ( 'data-theme' , theme === 'dark' ? 'dark' : 'light' ) ;
101
+ } , [ ] ) ;
100
102
101
103
return (
102
104
< GlobalProvider >
Original file line number Diff line number Diff line change 4
4
5
5
button {
6
6
padding : 8px 12px ;
7
- background-color : #f0f0f0 ;
8
- border : none ;
7
+ background-color : var (--menu-background );
8
+ color : var (--menu-text );
9
+ border : 1px solid var (--menu-text );
9
10
cursor : pointer ;
10
11
font-size : 0.9em ;
11
12
}
14
15
position : absolute ;
15
16
top : 100% ;
16
17
left : 0 ;
17
- background-color : white ;
18
- border : 1px solid #ccc ;
18
+ background-color : var ( --menu-background ) ;
19
+ border : 1px solid var ( --menu-text ) ;
19
20
box-shadow : 0 2px 5px rgba (0 ,0 ,0 ,0.1 );
20
21
z-index : 1000 ;
21
22
22
23
.category {
23
24
padding : 8px 12px ;
24
25
cursor : pointer ;
25
26
position : relative ;
26
- font-size : 0.9em ;
27
+ font-size : 0.9em ;
28
+ color : var (--menu-text );
27
29
28
30
& :hover {
29
- background-color : #f0f0f0 ;
31
+ background-color : var ( --menu-hover-background ) ;
30
32
}
31
33
32
34
.subcategory {
33
35
position : absolute ;
34
36
left : 100% ;
35
37
top : 0 ;
36
- background-color : white ;
37
- border : 1px solid #ccc ;
38
+ background-color : var ( --menu-background ) ;
39
+ border : 1px solid var ( --menu-text ) ;
38
40
box-shadow : 0 2px 5px rgba (0 ,0 ,0 ,0.1 );
39
41
width : 250px ;
40
42
display : flex ;
43
45
a {
44
46
padding : 6px 10px ;
45
47
text-decoration : none ;
46
- color : black ;
48
+ color : var ( --menu-text ) ;
47
49
font-size : 0.85em ;
48
50
49
51
& :hover {
50
- background-color : #f0f0f0 ;
52
+ background-color : var ( --menu-hover-background ) ;
51
53
}
52
54
}
53
55
}
54
56
}
55
57
}
56
- }
58
+ }
Original file line number Diff line number Diff line change 5
5
padding : 0 ;
6
6
font-family : Roboto, ' sans-serif' ;
7
7
-webkit-font-smoothing : subpixel-antialiased ;
8
+ color : var (--text-color );
9
+ background-color : var (--background-color );
8
10
}
9
11
10
12
$handleLen : 40px ;
@@ -167,7 +169,7 @@ $dragBarWidth: 10px;
167
169
display : flex ;
168
170
justify-content : space-between ;
169
171
align-items : center ;
170
- background-color : #f0f0f0 ;
172
+ background-color : #1B2A41 ;
171
173
}
172
174
173
175
.header-left {
@@ -178,4 +180,21 @@ $dragBarWidth: 10px;
178
180
flex : 18 ;
179
181
display : flex ;
180
182
justify-content : flex-end ;
181
- }
183
+ }
184
+
185
+
186
+ :root {
187
+ --text-color : #000 ;
188
+ --background-color : #fff ;
189
+ --menu-background : #fff ;
190
+ --menu-text : #000 ;
191
+ --menu-hover-background : #f0f0f0 ;
192
+ }
193
+
194
+ [data-theme = " dark" ] {
195
+ --text-color : #fff ;
196
+ --background-color : #000 ;
197
+ --menu-background : #333 ;
198
+ --menu-text : #fff ;
199
+ --menu-hover-background : #444 ;
200
+ }
Original file line number Diff line number Diff line change @@ -90,10 +90,6 @@ $headerHeight: 30px;
90
90
}
91
91
}
92
92
93
- .label {
94
-
95
- }
96
-
97
93
}
98
94
99
95
$btnSize : 48px ;
You can’t perform that action at this time.
0 commit comments