File tree 2 files changed +4
-7
lines changed 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -26,13 +26,9 @@ export function isObject(obj) {
26
26
27
27
// returns whether a dark theme is enabled
28
28
export function isDarkTheme ( ) {
29
- if ( document . documentElement . classList . contains ( 'theme-auto' ) ) {
30
- return window . matchMedia ( '(prefers-color-scheme: dark)' ) . matches ;
31
- }
32
- if ( document . documentElement . classList . contains ( 'theme-arc-green' ) ) {
33
- return true ;
34
- }
35
- return false ;
29
+ const isDarkTheme = window . getComputedStyle ( document . documentElement )
30
+ . getPropertyValue ( '--is-dark-theme' ) . trim ( ) . toLowerCase ( ) ;
31
+ return isDarkTheme === 'true' ;
36
32
}
37
33
38
34
// removes duplicate elements in an array
Original file line number Diff line number Diff line change 1
1
@import " ../chroma/dark.less" ;
2
2
3
3
:root {
4
+ --is-dark-theme : true ;
4
5
--color-primary : #87ab63 ;
5
6
--color-primary-dark-1 : #93b373 ;
6
7
--color-primary-dark-2 : #9fbc82 ;
You can’t perform that action at this time.
0 commit comments