-
Notifications
You must be signed in to change notification settings - Fork 174
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
daisyUI #169
Comments
As far as I can see, daisyUI just uses TW directly. Does not require any additional dependencies. So you can just copy/paste the daisyUI component HTML, and it'll work. |
Thanks for the quick answer, i guess. But this is not resolved. And i am not sure what you mean by "uses tw directly". But i could have been clearer and not assumed that daisy was a known thing. daisyUI defines classes that are used. Those classes are off course defined in terms off tailwind classes. But daisy is more on the bootstrap / component level and so the css needed is much less. To get the daisy css definitions, there is an npm install needed, and then a require in the tailwind config. See https://daisyui.com/docs/install/ Just adding the require into the tailwind.config.js throws an error as the daisyUI is not installed (via npm). Exact steps / expectations
Expect Result Note I have seen the setup for daisyUI done with js/css-bundling gems. And i managed to reproduce the necessary steps. Before i found this gem, and the hope kindled of getting rid of the js ecosysstem as i think you called in in the *Alpha preview: Modern JavaScript in Rails 7 without Webpack . So that is the dream i am dreaming, no esbuild, however fast it may be. |
Ah, I see. I thought these components were just using TW classes directly. Not defining their own. Anyway, there's no path for this to work with this setup. You'll need to use TW together with jsbundling-rails and a complete node setup. |
For people who came here from search engines, here is the solution: Everything will work smoothly. Yes, you will need additional I think you can even vendor this dependency and not rely on node at all, but I haven't tried it. |
@rozhok Thanks for providing this solution. I am finding that the animations for components are still not functional. Were you able to get them working properly (e.g. toggle button animations on click) |
@coderberry no, toggle animation does not work for me also. |
Hi! @import "tailwindcss/base";
@import "./daisyui.css";
@import "tailwindcss/components";
@import "tailwindcss/utilities"; Opened the daisyui.css file and added the at the top: @layer components {
... Original Daisy UI CSS.
} With this, tailwindcss-rails purge the unused CSS from DaisyUI CSS. |
So this looks like great work. It's been a while since i had the choices that come from setting up a new app, and tailwind with this webpacker free experience seems the way to go.
Alas, i am a one man show and don't want to write css from the start. But like the idea of tweaking later, grabbing compatible snippets and later on maybe even ditching daisy.
Not that i am (yet) married to daisy, i just want a head start (with a component framework).
I am surprised the question has not come up, ie how to do daisyUI with this gem. I fear one can't at the moment, but i also don't see if it could be made to.
Failing that, another framework? Or a mention in the readme.
The text was updated successfully, but these errors were encountered: