Install Tailwind CSS in Angular

Steps1 : Create project in Angular

ng new my-project
cd my-project

Step 2: Install Tailwind as local dependency

npm install -D tailwindcss postcss autoprefixer

Step 3: run the init command to generate a tailwind.config.js file.

npx tailwindcss init

Step 4: Configure your template paths- File created at

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [
  theme: {
    extend: {},
  plugins: [],

Step 5: Add the Tailwind directives to your CSS- add in style.css file

@tailwind base;
@tailwind components;
@tailwind utilities;

Step 6: Add below code in angular app.component.html for test

<h1 class="text-3xl font-bold underline">
  Hello world!