Skip to content

Dark mode is not working #18224

Answered by wongjn
MyDataHouse asked this question in Help
Jun 5, 2025 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

It seems like you're trying to use a dark class name to toggle between dark and light mode. By default, Tailwind uses the prefers-color-scheme media query. So, to use a class name toggle instead, you'd need to configure Tailwind to do so:

 @import "tailwindcss";

+@custom-variant dark (&:where(.dark, .dark *));

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MyDataHouse
Comment options

Answer selected by MyDataHouse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants