ON THIS PAGE

Tailwind CSS

Angular Tailwind Integration

2025-01-08

Install

Install tailwindcss and postcss as dev deps:

pnpm add -D tailwindcss postcss autoprefixer

Config

Configure Tailwind to scan for implemented class names:

// tailwind.config.js
module.exports = {
    content: [
        './src/**/*.{html,ts}',
        './src/app/**/*.{html,ts}',
        './src/components/**/*.{html,ts}',
    ],
    theme: {
        extend: {},
    },
    plugins: [],
}

Add Tailwind Directives to styles:

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

 

Copyright @ 2024 Anne Brown