feat: use dark theme for dark mode

This commit is contained in:
redhoodsu
2020-02-08 18:21:45 +08:00
parent 0c673d3c32
commit bb55425032
3 changed files with 109 additions and 2 deletions

View File

@@ -461,6 +461,40 @@ logger.on('debug', function (argList) {
});
```
## MediaQuery
CSS media query listener.
Extend from Emitter.
### constructor
|Name |Type |Desc |
|-----|------|-----------|
|query|string|Media query|
### isMatch
Return true if given media query matches.
### Events
#### match
Triggered when a media query matches.
#### unmatch
Opposite of match.
```javascript
const mediaQuery = new MediaQuery('screen and (max-width:1000px)');
mediaQuery.isMatch(); // -> false
mediaQuery.on('match', () => {
// Do something...
});
```
## MutationObserver
Safe MutationObserver, does nothing if MutationObserver is not supported.