An open API service indexing awesome lists of open source software.

https://github.com/emrocode/darkify-js

🌚 A simple dark mode toggle library
https://github.com/emrocode/darkify-js

automatic-theme color-scheme dark-mode darkify darkify-js light-mode night-mode npm-package theme-switcher theme-toggle typescript

Last synced: about 2 months ago
JSON representation

🌚 A simple dark mode toggle library

Awesome Lists containing this project

README

          

# Darkify JS
[![Run tests](https://github.com/emrocode/darkify-js/actions/workflows/tests.yml/badge.svg)](https://github.com/emrocode/darkify-js/actions/workflows/tests.yml)

🌚 A simple dark mode toggle library that makes it easy to implement dark mode on your website without additional configuration

> Please make sure to read the [Wiki] for detailed documentation and examples

### 📦 Installation

Use npm or any other package manager:

```bash
npm install darkify-js
```

### ⚙️ Setup

```js
// main.js
import Darkify from 'darkify-js';

const options = {
autoMatchTheme: true,
};

// autoMatchTheme: default is true
// useLocalStorage: default is true
// useSessionStorage: default is false
// useColorScheme: default is ['#ffffff', '#000000']

new Darkify('#element', options);
```

[Wiki]: https://github.com/emrocode/darkify-js/wiki