Why I prefer vanilla CSS over Tailwind
I have returned to writing vanilla CSS, and I love it.
Intro
So, why do I prefer vanilla CSS over Tailwind? That's what I'll tell you about here. One disclaimer before we continue: I like Tailwind, and I think it is awesome and helps you develop the UI very productively. Though, after a while of using it, I've come to prefer vanilla CSS over Tailwind.
My Tailwind
I try to customize my theme, colors, breakpoints, and so on. I try to avoid creating utility classes when writing tailwind, but I end up doing so quite often, the same goes with using arbitrary values in Tailwind.
I find it annoying that my classes end up becoming Tailwind classes with arbitrary values, mixed with utility classes.
I got enough of it.
I want to have full control over my styles and create the utility classes I want. Any value and any CSS property.
My CSS
I love vanilla CSS. The first feeling I get when writing vanilla CSS is power. Power over my styles, every pixel, and aspect of it.
I follow the BEM convention when writing my CSS.
My classes end up being a mix of the main class and the utility classes.
I also use CSS variables, especially when you don't want to repeat a value in numerous places.
For me, it is much easier to work with and maintain and makes me feel free.
Conclusion
This might just be me. I might be doing something wrong compared to other Tailwind users.
By the way, when it comes to the hover, active states, and so on, I enjoy customizing them in detail as well.
I love vanilla CSS:
- Gives me full power over the styles, every aspect, pixel, and state.
- With the BEM convention, it is easier to maintain.
- I can extract styles however I wish.