CSS
how to properly install tailwind css in react
@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";
how to properly install tailwind css in react
npx tailwind init tailwind.js --full
how to properly install tailwind css in react
npm install tailwindcss postcss-cli autoprefixer@9.8.6 -D
tailwind css in react
/* ./src/index.css */
@tailwind base;
@tailwind components;
@tailwind utilities;
Setup Tailwind CSS in react-native or react
// tailwind.config.js
module.exports = {
- content: [],
+ content: ["./App.{js,jsx,ts,tsx}", "./src/**/*.{js,jsx,ts,tsx}"],
theme: {
extend: {},
},
plugins: [],
}
tailwind css in react
npx create-react-app my-project
cd my-project
how to properly install tailwind css in react
const tailwindcss = require('tailwindcss');
module.exports = {
plugins: [
tailwindcss('./tailwind.js'),
require('autoprefixer')
],
};
tailwind css in react
// tailwind.config.js
module.exports = {
- purge: [],
+ purge: ['./src/**/*.{js,jsx,ts,tsx}', './public/index.html'],
darkMode: false, // or 'media' or 'class'
theme: {
extend: {},
},
variants: {
extend: {},
},
plugins: [],
}
tailwind css and react
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./src/**/*.{js,jsx,ts,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}
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"
}
tailwind css in react
// tailwind.config.js
module.exports = {
purge: [],
darkMode: false, // or 'media' or 'class'
theme: {
extend: {},
},
variants: {
extend: {},
},
plugins: [],
}
how to properly install tailwind css in react
setup tailwind css with react
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./src/**/*.{js,jsx,ts,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}
how to properly install tailwind css in react
npx create-react-app react-tailwindcss && cd react-tailwindcss