4 ms·
Thanks mate! I've been considering this path and may give it a go. Although, I'm still a bit nervous spitting utility classes all around. That sounds almost li
by stanislavb 5y ago
Thanks mate! I've been considering this path and may give it a go.
Although, I'm still a bit nervous spitting utility classes all around. That sounds almost like inline CSS and almost unmaintainable.
- aaronbrethorst 5y agoI had the same concern at first. I remained skeptical during my first couple days working with Tailwind, but came around pretty soon thereafter. I realized that all of my semantic CSS classes might as well have been inline CSS for all the good they were doing me on reusability. Utility classes are faster to work with, and, as long as you’re componentizing everything, still going to give you consistent styles across your product.
- ratww 5y agoThe usage of utility classes only become an issue if you have unnecessary duplication of components. Say, two buttons that should be the same but are implemented in different places. IMO one of the interesting parts of functional CSS is that we can apply the same tactics we use for organising code to organising the styling. Also, with separated CSS, and especially with semantic CSS, there is often a fair amount of duplication that happens in the CSS code itself, which we programmers tend to be very forgiving of. Giving Tailwind more scrutiny than we do for our CSS ends up making our code more consistent, less duplicated and better in general.