DEV Community

Setting Up Tailwind CSS 4.0 in Angular v19.1: A Step-by-Step Guide

Manthan Ankolekar on January 24, 2025

In this blog, I’ll guide you through setting up Tailwind CSS 4.0 in an Angular v19.1 project, allowing you to leverage utility-first styling for ra...
Collapse
 
ehsan_shahrestani_9f9d87c profile image
ehsan shahrestani

hi , my project has implemented with scss , when i import the tailwind in my style.scss file whay i get error

Collapse
 
manthanank profile image
Manthan Ankolekar

Even i had encountered, according to tailwind css documentation it working only with css. I will add in comment if i get solution to it.

Collapse
 
manthanank profile image
Manthan Ankolekar
Collapse
 
technbuzz profile image
Samiullah Khan

Maybe we drop scss as css can do the nesting, variables

Collapse
 
squeasy profile image
Abdullah Malik • Edited

Hi, this is probably because scss conflicts with Tailwind. Remove the scss configurations and usages from your project and retry. Also, check this out: tailwindcss.com/docs/compatibility...

Collapse
 
francoisjulienne profile image
JULIENNE François

I followed it step by step, and got this message when I launched ng serve :
"It looks like you're trying to use tailwindcss directly as a PostCSS plugin. The PostCSS plugin has moved to a separate package, so to continue using Tailwind CSS with PostCSS you'll need to install @tailwindcss/postcss and update your PostCSS configuration."

Collapse
 
ronenmagid profile image
Ronen Magid

doesn't work. styles aren't applied to the "Angular 19.1 + Tailwind CSS 4.0" text.

Collapse
 
anderson_topo profile image
Anderson Torres • Edited

replace the @import "tailwindcss"; with this in the styles.scss file

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

Collapse
 
shemjay profile image
Shem Jaoko

This does not true in the latest version of Tailwind currently which is v4 the syntaxt is just @import "tailwindcss";

Collapse
 
manthanank profile image
Manthan Ankolekar

Follow same steps.

Collapse
 
jsmeneses profile image
Johan Meneses

@apply and @reference doesn't work in css files

Collapse
 
stvnsaru profile image
stvnsaru • Edited

If it helps anyone... After step 1, run "ng serve" and continue with the following steps