This commit is contained in:
Your Name
2026-08-11 17:41:36 +08:00
parent cfe4c82c90
commit 03fe4ddf9d
18771 changed files with 3617239 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
var Emitter = require('./Emitter');
var MediaQuery = require('./MediaQuery');
var m = new MediaQuery('(prefers-color-scheme: dark)');
exports = {
get: function() {
return m.isMatch() ? 'dark' : 'light';
}
};
Emitter.mixin(exports);
m.on('match', function() {
return exports.emit('change', 'dark');
});
m.on('unmatch', function() {
return exports.emit('change', 'light');
});
module.exports = exports;