Live data from Hacker News

DaisyUI: Tailwind CSS Components

daisyui.com

171–180 of 181 posts

Re: DaisyUI: Tailwind CSS Components

#171

After 20 years, my little company still uses just HTML, CSS and JavaScript for everything including two sites I'd bet money most of you visit at least a couple of times a month.

I always find these sorts of weird-brags annoying. Either tell us the sites you built that are popular, or just don't comment about it at all.

Re: DaisyUI: Tailwind CSS Components

#172

I agree with others that this is not how Tailwind is meant to be used. For example, the approach shadcn ( https://ui.shadcn.com/ ) takes is much better IMO. Creating helpers like `btn` makes it very difficult to understand how it works and is not very customizable. Shadcn creates an actual component for you in your codebase and is just trivial Tailwind styles to modify.

I tried shadcn and didn't like it. I don't want a new component in my source tree that I have to maintain.

For nearly everything, I won't need to customize it (and if I do have to customize often, it probably means that particular component library wasn't a good choice).

And for the rare cases where I do need to customize something, I can always go into the source of the component library, copy what I want out into my project, and edit it.

> this is not how Tailwind is meant to be used

Who cares? If it works, and makes the development process easier, and doesn't cause problems, then that's a good thing.

Re: DaisyUI: Tailwind CSS Components

#173
post #94

I really don't understand why you use Tailwind for a CSS component library. To use your component library now people have to use Tailwind, while if you'd used regular CSS both sites with and without Tailwind could use the library (Tailwind is additive on top of CSS after all). Maybe it appeals to people in the Tailwind bubble, and gain momentum that way?

I'm using Tailwind mainly because it came installed by default with create-react-router-app, and it seemed easier to just go with the flow (this is my first web project in about 10 years, so I'm re-learning everything), rather than trying to come up with my own bespoke thing.

After learning it a bit, I liked Tailwind. Writing CSS manually sucks. It's fiddly, and often you have to sit around adding and changing random things until it looks the way you want, and you have no idea why what you did worked. Tailwind doesn't completely fix that, but it makes it significantly better.

But I don't feel like building my own components from scratch. That's where DaisyUI comes in to make my day easier. But if I want to override any of DaisyUI's choices, I have Tailwind's easier-to-use classes that I can use to easily do so.

Re: DaisyUI: Tailwind CSS Components

#174
So for everyone hating on Daisy and Tailwind, what is the alternative?

I do my best to use vanilla CSS, BEM style, with SCSS preprocessing, but it's not incredibly intuitive, it's apparently hard for most "full stack" devs to do because they think it is beneath them so they will reach for something like MaterialUI.

I agree with the criticisms about tailwind and Daisy but the problem these seem to solve that vanilla CSS does not is that Tailwind for all of its quirks requires less internal agreement than vanilla CSS. Without internal agreement every dev does their own crazy thing to the CSS and it turns to spaghetti fast.

So again my question is, what is my alternative here that gives me this property of "nicely packaged, well documented, modular, scalable CSS" without using Tailwind/Daisy?

Re: DaisyUI: Tailwind CSS Components

#175

So for everyone hating on Daisy and Tailwind, what is the alternative? I do my best to use vanilla CSS, BEM style, with SCSS preprocessing, but it's not incredibly intuitive, it's apparently hard for most "full stack" devs to do because they think it is beneath them so they will reach for something like MaterialUI. I agree with the criticisms about tailwind and Daisy but the problem these seem to solve that vanilla C…

BeerCSS, Bulma, Bootstrap, UIKit, Foundation. Feel free to add other full blown alternatives that offer a concept of primary, secondary for buttons etc.

Re: DaisyUI: Tailwind CSS Components

#176
post #168

Earlier quoted context omitted.

> So your component still has 60 tailwind classes on it? Yes, and this is better I think, because you still have only one button. So you just reuse the component. But if you make a .button class, now people are going to be tempted to use that to style their own buttons. And now, you have a dozen buttons and your app breaks in tiny little ways and your codebase is a hot mess.

> But if you make a .button class, now people are going to be tempted to use that to style their own buttons. How is having consistent design across the entire application a bad thing?

There has never been an application where I worked that anyone is happy with the base design of the button. There is always some variant, some edge case, some requirement that doesn't fit. This is the whole reason why BEM became a thing briefly and it was tedious. Tailwind solves all that. Just have a base set of styles, pass in any additional styles to the component based on the specific requirements and where the component is used, use tailwind-merge in the component and now I never have to care ever again.

Re: DaisyUI: Tailwind CSS Components

#177
post #89

Earlier quoted context omitted.

SCSS and Sass don't have a "gap-1"

Then how does tailwind implement it? Use that.

If I recall, the low effort way to do it in the past was to bring in another CSS framework eg. bootstrap, bulma, foundation, etc. So it seems, tailwind has brought it all together along with the improvements that were mentioned

Re: DaisyUI: Tailwind CSS Components

#178

So for everyone hating on Daisy and Tailwind, what is the alternative? I do my best to use vanilla CSS, BEM style, with SCSS preprocessing, but it's not incredibly intuitive, it's apparently hard for most "full stack" devs to do because they think it is beneath them so they will reach for something like MaterialUI. I agree with the criticisms about tailwind and Daisy but the problem these seem to solve that vanilla C…

BeerCSS, Bulma, Bootstrap, UIKit, Foundation. Feel free to add other full blown alternatives that offer a concept of primary, secondary for buttons etc.

Nice! I will check these out. Hoping a few of them are pure CSS.

Re: DaisyUI: Tailwind CSS Components

#179
post #167

Earlier quoted context omitted.

prolly a porn company

No. Restaurant chain and entertainment company

> "including two sites I'd bet money most of you visit at least a couple of times a month."

I mean, I don't think I use any restaurant chain web sites. So that leaves an entertainment company.

Netflix, Apple TV+, Disney? I mean... you did say most of us will use some of these sites every month. Most of the entertainment web sites that people use all the time are HUGE companies, why would they use your little company (your own words) ?

Re: DaisyUI: Tailwind CSS Components

#180
post #73

For those interested in how to use this with HTMX, read on. DaisyJS supports HTMX as it can work with just plain HTML without needing a fancy JS framework like Vue or React. You start by setting up something that can serve HTML and with a template engine. My favorite is Django. You also need daisyui, tailwindcss etc in a local NodeJS dir. Those parts aren't too hard, I'll skip over it. Now you make sure you build a s…

I found daisyui through Jeremy Howard’s (python) fasthtml.
Post reply on HN