DEV Community

Discussion on: A UseDarkMode react hook for everyone!

Collapse
 
kamil7x profile image
Kamil Trusiak

You can change tailwind config to darkMode: 'class' and then you can use <body class="dark"> to set dark mode regardless of user's prefers-color-scheme value.

Here you have an example play.tailwindcss.com/nQueSOesIA

In this case your hook might report incorrect value.