4 ms·
Sure, until, you need a variation on that card for some elements, and add some other tailwind classes to the HTML to do it. Everything seems to work fine for a
by jp_sc 7y ago
Sure, until, you need a variation on that card for some elements, and add some other tailwind classes to the HTML to do it. Everything seems to work fine for a while.
Then you update the styles of the card again but the new styles clash with the ones in those tailwind classes and you end with broken styles in some elements.
Mixing components and utility classes is a recipe for future chaos.
- city41 7y agoHow is that different from any other css? I'd argue any css solution would have this problem with components. edit: thinking more, you can override classes. So yeah, maybe utility/atomic classes are not as effective here.
- rojoca 7y agoNo, you just create a new card component and adjust the tailwind classes on it. Or, if it is a minor change, then conditionally include / exclude a small subset of tailwind classes. The point is to not write your own CSS, you only use tailwind classes. In this way you can look at the template for each of your components and reason about / edit their style and layout easily.