Adding dark mode support to a Tailwind website

Published under TailwindCSS.

With one simple configuration file change, you can add dark mode support to your Tailwind website:

This will add a dark: variant to Tailwind's classes. Whenever your user has dark mode enabled, the dark: classes will be enabled.

Example

There's more you can do with dark mode and Tailwind, all out of the box. I suggest you read the official documentation for more information.


Thanks for reading!

Did you find this post useful? Let me know on Twitter! If you found an issue with the content, submit a pull request!

Subscribe to my newsletter to know when I publish more content in the future.

❤️ Likes: 5
📣 Retweets: 3
💬 Replies: 0
🙊 Mentions: 0