johnny-dark-mode
v1.0.3
Published
dark mode lib
Downloads
13
Readme
Usage
npm
$ npm install johnny-dark-mode --save
import DarkMode from 'johnny-dark-mode'
function change(isDark) {
console.log(isDark)
}
new DarkMode({mode:'auto',callback:change})
.dark-mode{
background: black;
color: azure;
}
Options
div:string default 'html'
mode:string 'auto'|'light'|'dark' default 'auto'
class:string default 'dark-mode'
callback:function(isDark) default null
isDark 是否是暗黑模式
Methods
forceMode(mode:String):DarkMode //强制模式