Ok, I'll guess I'll be the lone voice of dissent here. I don't like it. I think it goes against the concept of utility classes / functional CSS. As soon as you start making component-level classes, things begin to become opinionated and you lose the universality. My understanding of the functional CSS approach was that you'd make a button component, and use the variety of "atomic" classes to style it. If you're using…
DaisyUI – Tailwind CSS Components
141–150 of 174 posts
Re: DaisyUI – Tailwind CSS Components
#142Ok, I'll guess I'll be the lone voice of dissent here. I don't like it. I think it goes against the concept of utility classes / functional CSS. As soon as you start making component-level classes, things begin to become opinionated and you lose the universality. My understanding of the functional CSS approach was that you'd make a button component, and use the variety of "atomic" classes to style it. If you're using…
Absolutes are the problem. DaisyUI gives the flexibility of using Tailwind directly or higher level classes. Tailwind is great but sometimes you end up having 10-15+ classes for basic components that makes the code harder to read and reason with. We should have utility classes and composability, but relying on them exclusively is also not necessarily the best way either.
That's my understanding at least, like if you want to make a button, instead of have the same 10+ classes posted everywhere you make a new class with @apply and keep the styles uniform.
Then in the future if you need to change one of the core utilities it's also easily updated to all you the @apply classes you make.
Am I misunderstanding the purpose? I've only used tailwind twice.
Re: DaisyUI – Tailwind CSS Components
#143Earlier quoted context omitted.
I've never used Tailwind, but am familiar with Bootstrap. When looking at the examples, the ones on the right looked pretty much exactly like Bootstrap and I didn't understand what was interesting or novel about it. Is the code on the left (with lots of classes) actually what tailwind is like to use in practice?
> Is the code on the left (with lots of classes) actually what tailwind is like to use in practice? As a fan of tailwind, I can say that I initially thought this was dumb and it would be hard to read through a huge number of classes applied to each HTML element. Later, I found that for many of my reusable components, I could combine classes into a single class. As an example, my stylesheet may look like this: @tailwi…
.button {
background-color: $gray-100;
border: 1px $gray-200
/\* so on... \*/
}
i don't understand how these "micro" css classes actually help versus just setting the property.Re: DaisyUI – Tailwind CSS Components
#144Earlier quoted context omitted.
Absolutes are the problem. DaisyUI gives the flexibility of using Tailwind directly or higher level classes. Tailwind is great but sometimes you end up having 10-15+ classes for basic components that makes the code harder to read and reason with. We should have utility classes and composability, but relying on them exclusively is also not necessarily the best way either.
Can't you just use @apply to make a single uniform style that utilizes all those classes? That's my understanding at least, like if you want to make a button, instead of have the same 10+ classes posted everywhere you make a new class with @apply and keep the styles uniform. Then in the future if you need to change one of the core utilities it's also easily updated to all you the @apply classes you make. Am I misunde…
However you have to use them yourself. With vanilla Tailwind there is no out of the box @apply directives already set you can use. Think of DaisyUI as basically a whole set of @applies someone already made for you.
For users new to frameworks with utility focus it can be less steep learning curve to experiment and all the out of the box abstractions can reduce the need for having your own.
Re: DaisyUI – Tailwind CSS Components
#145We've gone full circle - CSS components to inline CSS-in-HTML back to CSS components. But I actually think I will use this. A big problem with CSS is that you end up making overrides no matter how composable you make the classes. And some simple things (e.g. responsiveness) are unintuitive and / or annoying to do in CSS. Hence Tailwind's "CSS-in-HTML" mini classes. But that doesn't fill the core purpose of CSS, bigge…
I think the thing with Tailwind that people are missing is the opinion that CSS's bigger general purpose classes to avoid repetition have failed. However, most of us are using some kind of HTML templating system. What matters is that the design work only happens once in the code, repetition in the finished product is just fine. So moving the job of avoiding repetition out of CSS and into your HTML templating system i…
There are still some cases where classes are useful, like JS or when I have very different components with some shared style. But these are mostly edge cases. FreeMarker has some other problems though.
Re: DaisyUI – Tailwind CSS Components
#146I’m not saying this is ugly but the visual execution of some of these components is poor. No good usage of padding in some examples, poor ratios between the typography and the containers, inconsistent use of different line widths and border radius, weird and incosistent design choices in spacing and proportions… I mean. This looks alright and it will certainly make any UI look pretty decent, but the execution is not…
This sort of stuff was difficult to figure out when I was learning HTML/CSS, do you know of any guides which list similar rules and how to make "proper" use of properties like borders, padding, typography etc?
Re: DaisyUI – Tailwind CSS Components
#147Ok, I'll guess I'll be the lone voice of dissent here. I don't like it. I think it goes against the concept of utility classes / functional CSS. As soon as you start making component-level classes, things begin to become opinionated and you lose the universality. My understanding of the functional CSS approach was that you'd make a button component, and use the variety of "atomic" classes to style it. If you're using…
For a work project, I'd use just tailwind for the reasons you mention.
Re: DaisyUI – Tailwind CSS Components
#148Earlier quoted context omitted.
>If it's just one class per property, you could just type out the CSS. You can, but then it rarely happens that you want the CSS to be fixed in that way for all time: the brilliance of tailwind is that you get resposniveness just by adding a few more classes. You cannot do that with inline CSS.
This is the one pro-tailwind argument I can agree with. Sometimes I’ll use their shorthand md: & sm: in @apply in place of media queries. The advantage is that they remain local to their relevant selectors. Makes me think- all I would really want is to be able to have multiple values in css. Maybe something like . .card { width: 5rem md: 10rem; } Snap… am I on to something?
Re: DaisyUI – Tailwind CSS Components
#149That page is extremely slow without hardware acceleration. It (hw-accel) was off for me because I updated some things without restarting Chromium, but I dunno. It doesn't "spark joy" with me.
Re: DaisyUI – Tailwind CSS Components
#150I am new to UI/UX. Is it comparable to bootstrap? How is it actually different from the CSS and UI component libraries?
You could say it's a component library like Bootstrap but it's customizable in core because it's based on Tailwind CSS. For example if you want to customize a Bootstrap button, you need to write additional CSS files. With daisyUI you can simply add a class name.
No you don't need to write CSS files for that. Bootstrap also offers utility classes.
If I want to customize padding I can add "p-3" or "p-4" class for example.
Same for other properties including colors like "bd-blue-800".