Search code examples
reactjstypescripttailwind-css

I can't ignore the dark mode in my project for Mac. I'm using Next.js with React and TypeScript


I can't ignore the dark mode in my project for Mac. I'm using Next.js with React and TypeScript.

I tried the following, but it didn't work. What should I do?

const config: Config = {
  plugins: [
    require('@tailwindcss/forms'),
    // {Place of Concern}
  ],
}
  1. darkMode: 'media',
  2. darkMode: 'class',
  3. darkMode: false,

Solution

  • TottySnowman's comment guided me in the right direction:

    Did you check the globals.css file? There might be still some styles defined, that take over the root. If you just started the project it might be it!

    The issue indeed was that I had changed :root to white to override dark mode in globals.css.