Tailwind and Angular 20 #18333
-
Hi I am struggling to get Tailwind 4.1 to work with Angular 20.0.2. I continually get the following: Error: It looks like you're trying to use I have installed postcss but somehow this does not seem to work with angular. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Just use a suggested new separated PostCSS plugin of TailwindCSS. Related: https://tailwindcss.com/docs/installation/framework-guides/angular |
Beta Was this translation helpful? Give feedback.
-
In my case the fix was just install Tailwind v4, PostCSS, and the Tailwind CSS PostCSS Plugin
Create postcss.config.jsonTime to configure PostCSS. In the root of your Angular project (where your angular.json file is located), create a file named {
"plugins": {
"@tailwindcss/postcss": {}
}
} Import Tailwind Directives in styles. scssHere, we must do something slightly different because we've chosen SCSS. Other tutorials show using the Open the @use "tailwindcss"; alternative /* In styles.css */ @import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities"; |
Beta Was this translation helpful? Give feedback.
@apply
with Vue, Svelte, or CSS modules@apply
, Showing False Validation Errors