Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tailwindcss not working in create-react-app

Tags:

class

reactjs

I am using tailwindcss for the first time and especially in a react app. I followed the documentation, read some articles and watched some videos. I have my react-app running but tailwindcss classes do not reflect on the application. I have restarted the project from scratch severally but I still face the same issue. Here is my package.json

enter image description here

like image 386
Lihin Ogana Avatar asked Sep 11 '25 01:09

Lihin Ogana


2 Answers

I had to upgrade the react-scripts

npm i react-scripts@latest
like image 173
Ruhith Udakara Avatar answered Sep 14 '25 17:09

Ruhith Udakara


What I have done is

  • Updating version of tailwindcss,postcss,autoprefixer and react-scripts to the latest version.
  • Replacing tailwind.config content with
    content: ["./src/**/*.{js,jsx,ts,tsx}", "./index.html"],
like image 32
Kritarth Sharma Avatar answered Sep 14 '25 15:09

Kritarth Sharma