Create a new react project with yarn
yarn create react-app react-tailwind-css-stater
Enter fullscreen mode
Exit fullscreen mode
Install Tailwind CSS with postcss & autoprefixer
yarn add -D tailwindcss postcss autoprefixer
Enter fullscreen mode
Exit fullscreen mode
Generate tailwind.config.js
and postcss.config.js
yarn tailwindcss init -p
Enter fullscreen mode
Exit fullscreen mode
Modify tailwind.config.js
file
module . exports = {
content : [ " ./src/**/*.{js,jsx,ts,tsx} " ],
theme : {
extend : {},
},
plugins : [],
};
Enter fullscreen mode
Exit fullscreen mode
Add tailwind base, components and utilities to index.css
@tailwind base ;
@tailwind components ;
@tailwind utilities ;
Enter fullscreen mode
Exit fullscreen mode
Top comments (11)
cheers
ðŸ¤
nice good bro help
I followed the whole process and my app is running fine and no errors but tailwind css still isn't working for me
Share your git url so may be I can help
thanks man it help me a lot
I'm glad to hear it
Well done, cheers!
Thanks bro.
thanks