That 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.
DaisyUI – Tailwind CSS Components
131–140 of 174 posts
Re: DaisyUI – Tailwind CSS Components
#132Earlier quoted context omitted.
With Tailwind, if you write out something like that more than once or twice, you're really supposed to bundle it together. Either as a plain CSS class, or a component in your framework of choice. I suppose a library of common elements is a good thing to have, but the reason I like Tailwind is that I can use the utilities at first and then easily gather them together as plain CSS classes as and when that makes sense t…
But if you're going to hide away CSS inside a component, why not just use inline CSS? What does Tailwind add to this?
But in terms of structuring your code, there are related concepts in other areas of programming:
The most general concept applied here is stratification or layering. You want to decompose your code into more general pieces so you can use those pieces to compose the actual solutions.
Example: Say you wanted to write a compiler. It typically much easier to simplify, AKA decompose the compiler into a scanner, parser, analyzer, optimizer, emitter etc. The users of your compiler probably don't care that you decomposed and layered your code. But you do care, since you can reason about your code in terms of small/local problems. Maybe you don't stop there. Your scanner can be stratified further, so you can easily build evolve and reason about it.
This is the primary thing these types of libraries do. They give you generalized building blocks that have compositional semantics that make sense. You can use their sane defaults or generate them from scratch using a design system.
Secondly the atoms are discretely defined. You're not dealing with all possible values for each property but with sets that you can join/compose. The generated classes have this little mini-syntax that you first need to get used to a bit, but after a while you'll easily remember the prefix schema of your classes (Tailwind's documentation site is also very well made). Tailwind cross joins the atoms for you, but then also deletes all the classes you didn't use in your project.
Re: DaisyUI – Tailwind CSS Components
#133Re: DaisyUI – Tailwind CSS Components
#134Real nice, pity the "see component" popup that appears when clicking on anyhomepage component prevents from checking it out and there is no way to hide said popup Real nice, looks professional and casual - well done!
Re: DaisyUI – Tailwind CSS Components
#135My 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 a "btn" class etc, it muddles the distinction of where the semantics live, and things get harder to reason about / debug.
Re: DaisyUI – Tailwind CSS Components
#136Re: DaisyUI – Tailwind CSS Components
#137We'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 also never had to do it when I was using Emotion, and I used that for 2 years.
Re: DaisyUI – Tailwind CSS Components
#138Re: DaisyUI – Tailwind CSS Components
#139Ok, 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…
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.
Re: DaisyUI – Tailwind CSS Components
#140Earlier quoted context omitted.
I dislike Tailwind's choice of inlined styles in html, but I agree that the advice in the book is very good.
Unrelated tangent: I'm always frustrated when I see a recommendation for a book only to go and look it up and find that it's actually an "ebook" (in this case PDF). Not to make a value judgement on ebooks, but I just really like physical books sometimes - if it was on Amazon I likely would have bought it. Again, not a value judgement on the content - I'm sure it's great (I'm a paid and happy user of TailwindUI)