-
Notifications
You must be signed in to change notification settings - Fork 189
Use plugins with tailwind v4 #502
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
Hi @bogdan , Can you share the steps to reproduce? because it's working for me. My steps:
I can see this in the console when tailwind builds the assets now:
and I can see daisyui in the browser just fine. Do you have the It would be great If you can share more information. I don't think it's this project's responsibility to inform its users how to use tailwind plugins though. Specially because there's no extra steps to do it. Maybe I'm wrong and if I am, please correct me. |
It looks like in my case the issue is specifically with yarn and its https://yarnpkg.com/features/pnp I am not sure if this setup is something all js package managers will go, or it is never suppose to work everywhere. I checked If you don't plan to support that, you may close the issue. |
Oh, I see. Never used yarn pnp in the past so I can't really help with that setup. But the thing is that tailwindcss-rails (and more specifically tailwindcss-ruby) use the standalone tailwindcss cli (https://tailwindcss.com/blog/standalone-cli) which is not aware of the package manager you're using in the project. It only scans your project and if it can't find the necessary libs (daisyui in this case), it will error out. Ultimately, I think we can say tailwind (in general) and yarn pnp are not compatible. But i think you'd end up having the same issue if you use tailwind without this gem. |
Probably, yarn need to do a better job on making sure their new pnp feature is supported. Thanks for help. |
Yes, I agree! You're welcome! |
It would be nice to mention how to install plugins in the doc. It was a little confusing that Readme recommended to setup https://github.com/rails/tailwindcss-rails?tab=readme-ov-file#updating-css-class-names-for-v4 I thought using |
@bogdan Do you have time to open a PR suggesting some documentation? You have the context and experience, I don't. |
Hello @patriciomacadden and @bogdan, thanks for your answers. The Rails 8 application I'm working on uses no node package manager. I can confirm that installing the plugin as an npm package works. Running {
"devDependencies": {
"daisyui": "^5.0.0-beta.8"
}
} And then adding ➜ my-app git:(1-css) ✗ ./bin/rails tailwindcss:watch
/*! 🌼 daisyUI 5.0.0-beta.8 */
≈ tailwindcss v4.0.6
Done in 124ms However, the Daisy official documentation mentions that there is a way to install the plugin without npm intervention, Option B. Use daisyUI from CDN.. Sadly this way didn't work for me. I found this discussion in the tailwind-ruby's repository but the comments are saying the only way of installing Taiwind's plugins is via npm. Am I missing something here? It is like the comments contradict the plugin documentation. |
@hernanvicente My comment on that thread specifically says:
If you know how to do this, then please open a docs PR on this project or tailwindcss-ruby explaining how it's done. |
Like, just to be clear: I'm the maintainer of both tailwindcss-rails and tailwindcss-ruby, and I don't use tailwind plugins, and I'm not interested in learning how to do it just to explain it back to people. These are open-source projects and I expect users who do use plugins to contribute documentation and/or code for the features they use/want/need. I'm asking for help. |
I didn't find any way of adding a plugin in v4 setup.
Adding
package.json
doesn't help:Please suggest the doc on how to use plugins.
The text was updated successfully, but these errors were encountered: