-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[v4] Tailwind CSS v4 Beta does not work with Angular 16 after migration #15247
Comments
I'll echo this also does not work on a completely new Angular 19 project; issue is the same as described, that no styles are applied. |
Heya! Been looking into this and there seem to be an invalid setup for postcss in your example:
I was able to get it working in a new project with the following JSON postcss config file: {
"plugins": {
"@tailwindcss/postcss": {}
}
} (Here's the code I used if you're curious: https://github.com/philipp-spiess/tailwindcss-playgrounds/tree/main/angular. This uses local builds of the next beta release we're just testing but it also works with beta 4) So overall this does not seem like a Tailwind CSS bug but rather a restriction of how the Angular CLI works. 👍 Going to close this issue but let us know if you run into any other issues. |
I’ve tried following your approach with the postcss.config.json file and enabling Tailwind CSS via PostCSS for my Angular 16 project. Unfortunately, it didn’t resolve the issue for me. |
@dcheglakov Hm, this issue on the Angular CLI project suggests that you have to use something like an |
@philipp-spiess Thank you for the suggestion! I appreciate your help so far. My Angular project is already set up as an application project, so I believe that part is configured correctly. I’ll take your advice and ask about this in the linked Angular CLI issue to see if there’s something specific to Angular 16 that I might be missing. Thanks again for your time and support! 🙏 |
@dcheglakov: You need This is how my
Also the config file should be loaded in the main css file like this. |
@sharathdaniel thanks. I managed to use Tailwind 4 with Angular, but to do so, I had to upgrade to Angular 18. |
Did you followed any docs?, i am in angular 18 and i have the same problem |
Hi everybody. |
What version of Tailwind CSS are you using?
4.0.0-beta.4
What build tool (or framework if it abstracts the build tool) are you using?
Angular 16.2.16
What version of Node.js are you using?
20.14.0
What browser are you using?
Chrome, Safari, Arc
What operating system are you using?
macOS 15.1.1
Reproduction URL
https://github.com/dcheglakov/angular-tailwind
Describe your issue
I attempted to migrate from Tailwind CSS v3 to v4 following the documentation using
npx @tailwindcss/upgrade@next
. The process completed without errors, but the styles are no longer applied after the migration.Initially, I suspected the issue might be related to the prefix configuration, so I created a separate branch (no-prefix) to test the migration without a prefix. Unfortunately, the result was the same.
Here are the relevant branches in the reproduction repository:
Steps to reproduce:
Expected behavior:
The styles should work as they did in Tailwind CSS v3 after the migration process.
Additional Context
I followed the migration steps provided in the Tailwind CSS upgrade guide. Both the tailwind-4 and no-prefix branches demonstrate the issue. If any further information is needed, feel free to ask.
The text was updated successfully, but these errors were encountered: