ui icon indicating copy to clipboard operation
ui copied to clipboard

Theme doesn't work in dialogs when i added darkMode: "class" in tailwind.config.js

Open AmeerMuaviya opened this issue 2 years ago • 4 comments

Theme worked great when this code darkMode: "class" wasn't in tailwind.config.js but after adding it dialogs always appear in light mode.

AmeerMuaviya avatar Aug 09 '23 06:08 AmeerMuaviya

Hi @AmeerMuaviya, when darkMode is set to class the dark theme is applied when a component has the dark className applied to it. You can enable global dark mode by adding this class to the <html> tag. If darkMode is set to media the color scheme is applied based on the system configuration.

dan5py avatar Aug 09 '23 10:08 dan5py

Hi @AmeerMuaviya, when darkMode is set to class the dark theme is applied when a component has the dark className applied to it. You can enable global dark mode by adding this class to the <html> tag. If darkMode is set to media the color scheme is applied based on the system configuration.

Thanks for clarification. I noticed that modals & tosts appear in the root of the dom & I had applied class dark in parent div <div className="dark">{children}</div>

AmeerMuaviya avatar Aug 24 '23 08:08 AmeerMuaviya

I can also attest that dark mode doesn't work in dialog even when dark class is applied to html. Everything else works but most elements in dialog doesn't change from light to dark.

edyu avatar Sep 02 '23 20:09 edyu

having it as string works (darkMode: "class") for me, but Array<string> is not working.

itzsrikanth avatar Dec 31 '23 08:12 itzsrikanth

This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.

shadcn avatar Jun 11 '24 23:06 shadcn