-
Notifications
You must be signed in to change notification settings - Fork 1.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
Tailwind 4 support #7133
Comments
According to upgrade guide, you can still use a js config file https://tailwindcss.com/docs/upgrade-guide#using-a-javascript-config-file. The automated upgrade process will destroy your existing tailwind.config.js, but one can easily revert the deletion in git. Unfortunately, restoring the tailwind.config.js and including it as described does not appear to fix missing primeicons, otherwise it appears to work. |
The tailwind.config.js is now depracated and you shouldn't be using it. You should instead use a .css file for all your config. |
I'm also having problems to get Primevue work with Tailwind 4. Then I've followed the instructions on https://tailwind.primevue.org/nuxt/ (based on Tailwind 3, I know): I've then tried to do the config in main.css (because tailwind.config.js isn't needed any longer): @import './primevue/tailwind.css' layer(components); But always get a Error on the page: And in the console I get this after spinning up with npm run dev: Any help would be appreciated |
@janderegg PrimeVue doesn't work with Tailwind 4 yet |
I've got a Tailwind 4 version working using the official upgrade tool: First, I've got this error: ERROR Cannot start nuxt: 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. Fixed that by installing @tailwindcss/postcss: |
Do you mean Tailwind 4 version? |
of course, yes. changed it. |
You should be using the Vite plugin not postcss |
Primevue works successfully with tailwind v4. My styles file:
|
@OscarRaizer These styles do not look right with Tailwind 4 - https://tailwind.primevue.org/nuxt/#styles |
@martinszeltins Maybe, idk. It works for me. i dont use nuxt |
Everything should work if you follow the Tailwind v4 upgrade guide, tailwindcss-primeui will continue to work as well. As mentioned by @martinszeltins, if you are using Vite you should remove all postcss config and packages from your project and use the new Vite plugin instead. The following should be updated to reflect the new changes in Tailwind v4: Here are some projects I have successfully upgraded for those who might need a reference: |
This seemed to work for me: I have a fresh new VueJS project created with Vite (saying no to everything):
After
There's no tailwind.config.js file as noted on https://primevue.org/tailwind/, so I move on:
Download the .zip from https://github.com/primefaces/primevue-tailwind/releases and move/extract to I skip the postcss stuff, and then continue at: https://github.com/primefaces/primevue-tailwind/releases And add the following to
and I get this error (also noting the 'postcss' in there):
This seems to diverge from (or omit) what the Tailwind page says (https://tailwindcss.com/docs/installation/using-vite). So I then do:
Updating the CSS to only have:
At this point, there are no errors and directives seem to work well. I am having some issues with the scoped styles and Cheers! |
You have to use https://tailwindcss.com/docs/functions-and-directives#reference-directive |
EDIT: Here's a link to the article with instructions for PrimeVue and Tailwind 4 I've updates the integration to work with Tailwind 4 by making the following changes:
Change the cssLayer.order in app.ts from .use(PrimeVue, {
theme: {
preset: customTheme,
options: {
cssLayer: {
name: "primevue",
order: "base, primevue",
},
darkModeSelector: ".dark",
},
},
}) import tailwindcss and the tailwindcss-primeui plugin at the top of your main app.css @import "tailwindcss";
@plugin "tailwindcss-primeui"; |
Hi, my project is using Primevue + SCSS and Tailwind. When using the Tailwind upgrade tool, did you face any error? I'd like to compare if we faced similar issues. I have followed the instructions for PrimeVue and Tailwind 4 but still does not work for me. |
Make sure you run that command from the root of your project and not just from your home folder. Running that command was a pretty smooth process when I did it. |
This isn't actually related to PrimeVue, and is and issue you're running into with the Tailwind upgrade process. Questions about their utility should probably be posted in the Tailwind repo. That being said, it looks like the migration tool doesn't support .scss: tailwindlabs/tailwindcss#15716 |
Hi! Great to confirm that https://gearboxgo.com/articles/web-application-development/primevue-with-tailwind-40 works well for me. Thanks @Smef! For anyone looking to migrate their SCSS project to Tailwind 4, here's the process I followed:
|
I did it exactly like that, but I dont see any styling from the tailwind primevue css files. Do I have to load them in somewhere? |
@maxih4 PrimeVue doesn't support Tailwind 4 yet. |
I got it working by doing the following:
on my main.css file @import "tailwindcss";
@plugin "tailwindcss-primeui";
@import "./primevue/tailwind.css"; /* styles downloaded from the zip file */ on the app.js file app.use(PrimeVue, {
theme: {
preset: 'none',
options: {
cssLayer: {
name: "primevue",
order: "base, primevue",
},
darkModeSelector: ".dark",
},
},
})
thanks @Smef and @connorabbas |
Describe the bug
Tailwind 4 has been released. It does not use postcss anymore but Vite plugin and does not use .js file for config but all config goes in .css file. The instructions on PrimeVue Tailwind are wrong now with Tailwind 4. Lots of things have changed in Tailwind 4, including classes, layers, variables etc. Also the instructions on tailwind.primevue.org is out of date now.
https://tailwind.primevue.org/nuxt/
Pull Request Link
No response
Reason for not contributing a PR
Other Reason
No response
Reproducer
https://tailwind.primevue.org/nuxt/
Environment
n/a
Vue version
3.5.13
PrimeVue version
4.2.5
Node version
20
Browser(s)
No response
Steps to reproduce the behavior
n/a
Expected behavior
n/a
The text was updated successfully, but these errors were encountered: