1

I have installed tailwind css then installed daisyUI. After running my react app it is showing dark theme. I want to remove it. Here is the tailwind.config.js file.

module.exports = {
  content: ["./src/**/*.{html,js}"],
  theme: {
    extend: {},
  },
  plugins: [require("daisyui")],
};```
Sakin
  • 53
  • 7

1 Answers1

4

You can remove all themes by adding these lines to exports object in your tailwind.config.js

daisyui: {
   themes: false,
}

Like this:

tailwind.config.js

module.exports = {
  content: ["./src/**/*.{html,js}"],
  theme: {
    extend: {},
  },
  daisyui: {
     themes: false,
  }
  plugins: [require("daisyui")],
};

This way you are left with light theme only.

Or you can include only the themes you require using this configuration.

module.exports = {
  content: ["./src/**/*.{html,js}"],
  theme: {
    extend: {},
  },
  daisyui: {
     themes: ["cupcake", "cmyk"],
  }
  plugins: [require("daisyui")],
};

Refer to docs for more details.

I hope it helps!

Amit
  • 1,018
  • 1
  • 8
  • 23
  • Tried not working. Looks like the problem is in "plugins: [require("daisyui")]" here. After removing this code the dark theme goes away so is the styles. – Sakin May 15 '22 at 09:26
  • 1
    But that would completely remove daisyui from your app. I've tried and tested the solution. Setting `themes: false` should work. Make sure your implementation is correct. – Amit May 15 '22 at 12:18
  • And remove `data-theme` attribute from body element if you've attached it while installing **daisyui**. – Amit May 15 '22 at 12:19
  • `themes: false` doesn't work. I removed everything but `content` and `plugins` and still showing dark theme. There was no data-theme but I added one setting the color light. Now it' showing white background. Now the problem is when I set some custom theme inside `daisyui: { themes: ["cupcake", "cmyk"], }` and use those in my project they don't work. – Sakin May 15 '22 at 22:04
  • If you are using `theme-change`, check localStorage theme setting. – Jun Jul 30 '22 at 04:12