tailwind for react code example

Example 1: commmand for installing tailwind to react

npm install tailwindcss

Example 2: how to setup tailwind for reactjs

npm install -D tailwindcss@npm:@tailwindcss/postcss7-compat @tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9

Example 3: how to properly install tailwind css in react

npx tailwind init tailwind.js --full

Example 4: how to properly install tailwind css in react

"scripts": {
  "start": "npm run watch:css && react-scripts start",
  "build": "npm run watch:css && react-scripts build",
  "test": "react-scripts test",
  "eject": "react-scripts eject",
  "watch:css": "postcss src/assets/tailwind.css -o src/assets/main.css"
}

Example 5: how to properly install tailwind css in react

npm install tailwindcss postcss-cli [email protected] -D

Example 6: how to properly install tailwind css in react

npx create-react-app react-tailwindcss && cd react-tailwindcss

Tags:

Html Example