-
Notifications
You must be signed in to change notification settings - Fork 12k
Support tailwind v4 #28938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Custom postcss configurations are possible with the As tailwindcss v4 moves towards a stable release, we are also evaluating direct inclusion of the optimized pipeline present in the Vite plugin to avoid the need for postcss if preferred. |
@clydin looks like |
@clydin I’ve tried following your approach with the {
"plugins": {
"@tailwindcss/postcss": {}
}
} for my Angular 16 project. Unfortunately, it didn’t resolve the issue for me. Maybe there’s something specific to Angular 16 that I might be missing? Thank you. |
Custom postcss configuration is only supported with the Angular v16 is also no longer supported. Please consider upgrading to a newer and supported version. |
I can confirm the |
Should this be documented? I would never know about this if I didn't accidentally clicked into this issue. @clydin |
And it's released! |
Their installation guide for Angular works fine, I was able to make it work in an Angular v19 app following that guide, even with plugins. It would be nice if we could do it without |
A small downside here is that the angular cli package complains about using v4 |
Released! Would be nice to not have to use postcss to also use tailwind. Shouldn't be too hard to support given it uses vite now
|
this peerDependency is locked to tailwind v2–3: https://github.com/angular/angular-cli/blob/main/packages/angular_devkit/build_angular/package.json#L84 |
I have the same error |
Same here, can't deploy to Firebase |
would be nice if at least the peer dependency could be updated to |
With Vite and a new Angular 19.1 app, it fails too. |
It seems the problem is resolved for me, if I add |
Tailwind 4 stylePreprocessorOptions includePaths is not working with That makes using component styles with If you have a project that uses |
@bugproof it works for me only with @reference "tailwindcss"; |
yes but if you have custom utilities and theme then it doesn't work. Imagine you define in main.css
then if you try to Please see https://tailwindcss.com/docs/functions-and-directives#reference-directive So really for certain angular projects migration from v3 is not so easy. |
@sheikalthaf it is for you. |
@bugproof I'm having the same issue, the Is this something angular have to fix or is this something for tailwind itself? |
@EinfachHans tailwindlabs/tailwindcss#15778 (comment) I'm glad I'm not the only one who thinks Apparently it's possible to create an alias using vite to make it less painful but angular doesn't allow custom vite configs. It's hard to say. I think tailwind team could give us a better solution for this problem. I have no idea. I tried migrating to v4 in one angular project but it turned out to be too painful due to Tailwind team alone should be able to enhance this feature. But angular team also could help to deal with the current issue by adding support for For certain projects it can take entire day to port to v4. Right now component styles are useless with how things are. |
Unfortunately, the alias suggestion would not be useful in this case since Tailwind performs its own internal stylesheet resolution and its postcss plugin does not currently provide any options to customize its behavior in this regard. |
For Tailwind support, the latest patch released today (19.1.5) includes two improvements:
|
Hey @clydin - thanks for your response! So the only thing that is left from angular side is the detection of tailwind, that should also work without the "old" tailwind config file? About the |
Is the guide from the official tailwindcss docs still relevant? You need |
Yes, the guide (https://tailwindcss.com/docs/installation/framework-guides/angular) is still relevant and accurate. It mentions those packages/files. |
Hey guys, I am getting an error when trying to run ng test:
Any workaround? |
@gamoreli Could you share your |
|
Apparently we had this issue with other developer some weeks ago, and the issue was move to "Not Planned", I didn't get it. #29690 |
as currently only v3 is working: https://v3.tailwindcss.com/docs/guides/angular |
I am also facing same issue in angular. I am creating a library in angular and using storybook. But with the tailwind 4, as default there is no config file, but we can include it which i tried like this: when i tried the same with tailwind4 as config file is allowed, i am getting error:
there is something from this line of code i think is not able to process the config file properly in tailwind4, that'll be due to Angular code that only integrates v3:
For v4, it should resolve @tailwindcss/postcss. If any one has any workaround for this that will be useful. |
@clydin can you have a look to this, and can reference to me anything where i am wrong. |
Command
build
Description
Tailwind v4 is changing the installation and configuration. It would be great to update the cli to make sure v4 is supported.
Describe the solution you'd like
The cli should support the new postcss plugin https://tailwindcss.com/docs/v4-beta#installing-with-post-css
Also detection probably has to be changed as v4 no longer uses js to configure tailwind but instead css variables https://tailwindcss.com/docs/v4-beta#installing-with-post-css
I guess the best detection at this point is having tailwindcss with a version >4 installed and ideally the cli also makes sure @tailwindcss/postcss is installed.
Describe alternatives you've considered
Tailwind also offers a vite plugin, but to my understanding, postcss should be easier to support
The text was updated successfully, but these errors were encountered: