themesberg / flowbite

Open-source UI component library and front-end development framework based on Tailwind CSS
https://flowbite.com
MIT License
7.55k stars 715 forks source link

how to disable dark mode #661

Closed vinayiaastha closed 10 months ago

vinayiaastha commented 11 months ago

Describe the bug How to disable dark mode in flowbite in nextJS without removing dark mode css

image

Description: Right now I have not added dark or light mode functionality to the project but since there is a default dark mode css, I auto-applied the dark theme from the dark mode of the system. How to stop it so that only light mode is shown to the user?

canaleal commented 11 months ago

Hello @vinayiaastha , could you upload an image of the tailwind.config.js file?

By default, dark mode is set to media (Computer preferences), and you'll need to set it to false inside the tailwind.config.js as shown here to only show light mode.

zoltanszogyenyi commented 10 months ago

Hey @vinayiaastha @canaleal,

That's right, that is the best way to disable dark mode for Flowbite and Tailwind CSS.

We may add a feature to the docs to remove the dark mode variants if needed, but that's for another issue.

Cheers, Zoltan