tailwind.config.js.You can install Tailwind CSS via PostCSS or using frameworks like Next.js, Vite, or CRA.
Here’s a basic setup using npm:
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
This will generate:
tailwind.config.jspostcss.config.jsUpdate your tailwind.config.js file to set the content paths:
module.exports = {
content: [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}
In your main CSS file (e.g., index.css or globals.css), add:
@tailwind base;
@tailwind components;
@tailwind utilities;