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

https://github.com/pablopunk/dark-mode-code

Automagically use dark mode detection on your website
https://github.com/pablopunk/dark-mode-code

Last synced: about 1 year ago
JSON representation

Automagically use dark mode detection on your website

Awesome Lists containing this project

README

          

# dark-mode-code

Example in react:

```js
const darkModeCode = require('dark-mode-code')

//...

//...
```

## Features

* Automatically set `` if the client OS is in dark mode.
* Automatically update the former class when the client changes the mode when using the website.
* Expose a method to manually toggle the theme: `window.__toggleDarkMode()`

## Author

| ![me](https://gravatar.com/avatar/fa50aeff0ddd6e63273a068b04353d9d?size=100) |
| ---------------------------------------------------------------------------- |
| [Pablo Varela](https://pablo.pìnk) |