4 ms·
I'm a tailwind fiend, ie I like tailwind, but I can say it won't save bytes in the source if you use it the way that the docs intend. Tailwind is not very DRY s
by adhoc_slime 4y ago
I'm a tailwind fiend, ie I like tailwind, but I can say it won't save bytes in the source if you use it the way that the docs intend. Tailwind is not very DRY so you'll probably end up repeating classes in source resulting in extra bytes if you just used a custom class repeated on similar components.
- solumunus 4y agoBut you can create custom classes using @apply. If you're doing that alongside using it in components then it's incredibly DRY and far more efficient than anything else I've ever used in the last 20 years.
- candiddevmike 4y agoWhat's the difference between custom tailwind classes and... regular CSS?
- gedy 4y agoOr Bootstrap, etc. This is why we didn't end up using TW for a large production app. It's really cool, but realized we were just ending up re-creating something like Bootstrap components using TW @apply.
- verisimilidude 4y agoNot much. Tailwind's @apply just lets you apply Tailwind design tokens to CSS classes. It's useful for keeping designs looking consistent if you're already heavily invested in Tailwind. This is probably not much of an advantage unless you're working at a very large organization with many teams and web properties. And there are other CSS-native ways of enforcing design token consistency without Tailwind too. Open Props is a good example (https://open-props.style/ https://open-props.style/). @apply is also a great lazy way to just slap a string of Tailwind classes from mark-up into a class. It doesn't sound proper but it works in the context of iterative development.
- solumunus 4y agoOnce familiar, it's far quicker to read, write and reason about than raw CSS, in my experience.
- adhoc_slime 4y agoAbsolutely, I love @apply for this reason. But just look at tailwind's website, they don't exactly present this front and center, so I read their site as though they don't exactly prescribe the usage of @apply like you or I would. but tangentially to this, that's why I like tailwind, its really not all that prescriptive but a tool that speeds up my development un-equivocally more than Sass ever has.
- corobo 4y agoIsn't this negated by everything being zipped up in transit? The more you repeat yourself the better it compresses
- adhoc_slime 4y agoRight but that isn't actually the source, which was the point that the parent commenter was making.
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]