1.4.0 • Published 3 years ago

edarkmode v1.4.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

edarkmode.js

A little JavaScript library to add darkmode in your project, its simple and with customizable colors.

This library automatically detects the device's thema and if the user decides to change it, it is saved using "LocalStorage".

Compatible with Tailwind CSS.

Usage

<button id="toggle-darkmode-button"> Change Theme </button>
/*light mode colors*/
:root {
    --bg: #fff;
    --button: #FCFCFC;
    --text: #777;
}

/*dark mode colors*/
html.dark {
    --bg: #222;
    --button: #444;
    --text: #fff;
}

Installation

<script defer src="https://cdn.jsdelivr.net/gh/LucianoBrumer/edarkmode.js@latest/src/edarkmode.min.js"></script>
//https://github.com/LucianoBrumer/edarkmode.js/blob/page/edarkmode.js
<script src="edarkmode.js"></script>
npm i edarkmode

Demo

https://codepen.io/lucianobrumer/pen/abEVGpK

1.2.4

3 years ago

1.2.3

3 years ago

1.4.0

3 years ago

1.3.1

3 years ago

1.2.2

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago