sandoche / Darkmode.js

🌓 Add a dark-mode / night-mode to your website in a few seconds
https://darkmodejs.learn.uno
MIT License
2.72k stars 176 forks source link

How to customize the div of the switch button #19

Closed weii2008 closed 4 years ago

weii2008 commented 4 years ago

I don't want the default button, how can I design it according to my own div?

sandoche commented 4 years ago

You can use it with these methods:

const darkmode =  new Darkmode();
darkmode.toggle();

// check if it is activated
console.log(darkmode.isActivated())