Answers for "best way to use tailwind in react"

19

create react app with tailwind

1. Create React Project
	npx create-react-app my-project
	cd my-project
  
2. Install Tailwind CSS
	npm install -D tailwindcss postcss autoprefixer
	npx tailwindcss init -p

3. Configure your template paths
	add the following code to your `tailwind.config.js` file:
   	content: [
    	"./src/**/*.{js,jsx,ts,tsx}",
  	],

4. Add the Tailwind directives to your CSS
	add the following code to your `./src/index.css` file:
	@tailwind base;
	@tailwind components;
	@tailwind utilities;

5. Start your build process
	npm run start
Posted by: Guest on January-04-2022
5

how to setup tailwind for reactjs

npm install -D tailwindcss@npm:@tailwindcss/postcss7-compat @tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9
Posted by: Guest on April-17-2021

Code answers related to "best way to use tailwind in react"

Code answers related to "Javascript"

Browse Popular Code Answers by Language