Created
December 30, 2020 04:10
-
-
Save hahwul/008a9249afc2918cc1836dedccb3dc0c to your computer and use it in GitHub Desktop.
Darkmode with js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Included this js | |
// <script src="https://cdn.jsdelivr.net/npm/darkmode-js@1.5.7/lib/darkmode-js.min.js"></script> | |
const options = { | |
bottom: '64px', // default: '32px' | |
right: 'unset', // default: '32px' | |
left: '32px', // default: 'unset' | |
time: '0.5s', // default: '0.3s' | |
mixColor: '#fff', // default: '#fff' | |
backgroundColor: '#fff', // default: '#fff' | |
buttonColorDark: '#100f2c', // default: '#100f2c' | |
buttonColorLight: '#fff', // default: '#fff' | |
saveInCookies: false, // default: true, | |
label: '🌓', // default: '' | |
autoMatchOsTheme: true // default: true | |
} | |
const darkmode = new Darkmode(options); | |
darkmode.showWidget(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment