top | item 44650101

(no title)

kylecordes | 7 months ago

Historically, the way to standardize how a component appears with Tailwind is to use component abstraction in whatever tool you are building with to accomplish that. Define a button once somewhere and then throw on whatever classes it needs.

If you were copy-pasting long strings of Tailwind classes all over, you were already doing it wrong before you even heard of Daisy.

discuss

order

qq99|7 months ago

Sure, you might make a `<Button>` UI component (assume React), but if it embeds 30 classes in it, when you server-render this, every button on your page is contributing ~30 classes worth of bytes to the payload sent across the wire.

freeone3000|7 months ago

The need for a component abstraction is the problem?

`<button class=“steve”>` will render like every other steve button, subject to context, cascading down the rules, and applied globally.

You don’t need anything for this but CSS and HTML.

stagas|7 months ago

The thing with Tailwind, however, is it reduces your options by picking a certain set of values, where with CSS you can choose whichever, so it becomes easier to have something that is more symmetric and looks better using Tailwind rather than CSS for this reason.