1.0.0 • Published 3 years ago

tailwind-dark-mode-code v1.0.0

Weekly downloads
7
License
-
Repository
-
Last release
3 years ago

tailwind-dark-mode-code

Example in react:

const darkModeCode = require('tailwind-dark-mode-code')

//...
  <script dangerouslySetInnerHTML={{ __html: darkModeCode }} />
//...

Features

  • Automatically set <html class="dark"> if the client OS is in dark mode.
  • Automatically update the former class when the client changes the mode when using the website.
  • Compatible with Tailwind built-in theme changer (using LocalStorage).

Author

me
Pablo Varela