mirror of
https://github.com/liriliri/eruda.git
synced 2026-03-20 09:38:37 +08:00
feat: use dark theme for dark mode
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user