5 ms·
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
by kylecordes 1y 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.
- qq99 1y agoSure, 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 1y agoThe 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 1y agoThe 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.
- freeone3000 1y agoThis can also be solved by having good design sense, and doesn’t necessitate a builder library. Having your own style also breaks websites out from all looking the same.