First need to Install Tailwind CSS using CLI command :
npm install -D tailwindcss postcss autoprefixer
Next Run init command to generate tailwind.config.js
npx tailwindcss init
Configuring template paths :
In tailwind.config.js
/** @type {import('tailwindcss').Config} */
module.exports = {
...
content: [
"./src/**/*.{html,ts}",
],
...
}
Adding the Tailwind directives to your CSS :
In style.css
@tailwind base;
@tailwind components;
@tailwind utilities;