3 ms·
The author didn't touch one of the biggest issues of Tailwind. It ignores the Cascade part of CSS. Even after optimizing Tailwind. You still end up with way mo
by shadowfaxRodeo 6y ago
The author didn't touch one of the biggest issues of Tailwind. It ignores the Cascade part of CSS.
Even after optimizing Tailwind. You still end up with way more css than you should have. Add all the classes in the HTML and you're sending users a massive amount of data.
Instead of writing:
main > * + * {
margin-top:1rem
}
you write `mt-100` a thousand times.
- criswell 6y agoThere's `space-y-N` which does exactly this, `space-x-N` for horizontal.
- Scooty 6y agoWhat do you do with that snippet when you realize some elements arbitrarily need more or less spacing than others because the designer decided it looks better? Repeating yourself isn't the end of the world, and on occasion DRY is worse (look up incidental duplication).
- tvphan 6y agoMate, there is a `space-y-1` helper class.