File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -105,8 +105,12 @@ class Framework7 extends Framework7Class {
105
105
const html = document . querySelector ( 'html' ) ;
106
106
if ( media === DARK ) {
107
107
html . classList . add ( 'theme-dark' ) ;
108
+ app . darkTheme = true ;
109
+ app . emit ( 'darkThemeChange' , true ) ;
108
110
} else if ( media === LIGHT ) {
109
111
html . classList . remove ( 'theme-dark' ) ;
112
+ app . darkTheme = false ;
113
+ app . emit ( 'darkThemeChange' , false ) ;
110
114
}
111
115
} ;
112
116
@@ -158,8 +162,12 @@ class Framework7 extends Framework7Class {
158
162
}
159
163
if ( app . mq . dark && app . mq . dark . matches ) {
160
164
html . classList . add ( 'theme-dark' ) ;
165
+ app . darkTheme = true ;
166
+ app . emit ( 'darkThemeChange' , true ) ;
161
167
} else if ( app . mq . light && app . mq . light . matches ) {
162
168
html . classList . remove ( 'theme-dark' ) ;
169
+ app . darkTheme = false ;
170
+ app . emit ( 'darkThemeChange' , false ) ;
163
171
}
164
172
}
165
173
You can’t perform that action at this time.
0 commit comments