Search code examples
cssreactjswebpacktailwind-css

Tailwind class doesn't take effect


I created a react setup for a little project and decided to add tailwind. It was successful but when I add the class to the components, I don't see any change.

This is the link to the repository


Solution

  • I found the problem. It was from my webpack config for CSS loader. I noticed when I added my own stylesheet, not all the rules were applied.

    {
            loader: "css-loader",
            options: {
              modules: true,
              importLoaders: 1,
              sourceMap: true
            }
          }
    

    I had to remove all the options. I don't even know why I added it at first. Tailwind CSS now works.