36 ms·
No one missed anything. Most people now are using React with Tailwind, so their code is essentially <Button>React Button</Button>
by csomar 2y ago
No one missed anything. Most people now are using React with Tailwind, so their code is essentially
<Button>React Button</Button>
- pier25 2y agoHow is this a good thing? You now need the extra JS from that <Button> component to encapsulate the HTML with TW classes. Plus all the overhead from TW itself. You need a ton of classes to essentially replicate inline styles. Plus all the CPU needed to parse and execute all that extra JS and CSS code. I get that some people prefer this workflow and that's fine, everyone has preferences. But arguing this is better than sending an HTML tag with a couple of classes is absurd.
- csomar 2y ago> You need a ton of classes to essentially replicate inline styles. This works better for optimization because you reuse classes. End developer doesn't care. Designers use Storybook to keep track of the components. > But arguing this is better than sending an HTML tag with a couple of classes is absurd. If you compile/SSR your React, the end user will get an HTML tag with classes.
- wruza 2y agoIs this specific to react?
- xigoi 2y ago> If you compile/SSR your React, the end user will get an HTML tag with classes. Isn’t that just semantic HTML with extra steps?
- pier25 2y agoWith Bulma/Bootstrap you're also reusing classes but you just need a fracion of those compared to TW. I don't know the ratio but I would imagine it's something like 1:10. And when using TW with SSR you're still sending all those extra classes per element.