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
 
youssefathalla profile image
YousseFathalla •

if the error saying that u need to use @use ignore it cuz tailwind v4 still not working well with angular19

if u use @use it will work but the extension for tailwindcss will not work

and also consider watching this for more info

https://www.youtube.com/watch?v=s-TAV5pQfcU&list=WL&index=2

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
 
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
 
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
 
hope_horizon_dc1ff248109c profile image
Hope Horizon •

hi , i did everything , but when try to test if tailwind css works : tailwind works
i gt a html button , no styles

Collapse
 
jsmeneses profile image
Johan Meneses •

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

Collapse
 
javavista profile image
Javier Carrion •

I wish it was straight forward like the article says. Most Angular project use the scss as their setup. This article should have address that.

Collapse
 
manthanank profile image
Manthan Ankolekar •

Yes, it is...

Collapse
 
mimi_benrayana_560cba8eb profile image
mimi ben rayana •

tailwind v4 does not pickup classes from npm package, any ideas please?

Collapse
 
stvnsaru profile image
stvnsaru • • Edited

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

Collapse
 
mixail_svetlov_8bf47156ee profile image
Mixail Svetlov •

The biggest stupidity in 2025 is to use css and Tailwind )))

Collapse
 
carlos_manuelrocharuiz_ profile image
Carlos Manuel Rocha Ruiz •

I'm experiencing some issues; when I create a single view, it looks good, but when I break it into angular components, it starts to look odd. Are there some CSS styles that have not been inherited?