Skip to content

pablopunk/tailwind-dark-mode-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks