4 ms·
I have been using Tailwind CSS for about a year now, both on my own product and 2 products from 2 different founders I work with from On Deck. Here is what I h
by brainless 6y ago
I have been using Tailwind CSS for about a year now, both on my own product and 2 products from 2 different founders I work with from On Deck.
Here is what I have to share:
1. Tailwind Makes Your Code Difficult to Read
Tailwind CSS, in my opinion, is the easiest to read and understand what is actually happening. Yes I agree there is a learning curve to the shorthand notations but the naming is not bad at all as the author says. A couple days of light use and the system was in my head. Saying this as a full-stack engineer who deals with React + Python and devops. So I do not ONLY look at CSS shorthand notations all day.
The example with the really long string of Tailwind CSS classes do not occur with me since such a complex string of classes is probably going into a component that needs customization from React component parameters. So I build the Tailwind CSS class names line by line with if-blocks or similar.
2. Tailwind Is Vendor Lock-in
"Once you build an app with Tailwind, moving it to any other CSS framework or library in the future is going to be grueling." - the whole point of Tailwind CSS is not to move to a framework. Your JS components mixed with the CSS are exactly your own branded framework. I am not sure I understand the move argument.
Even though all the products I work with are small, we have new frontend engineers helping out and it took them less that an hour to find the right Tailwind CSS class and making pixel-perfect components. This is close to CSS yet comfortable to see and existing project and contribute.
3. Tailwind Is Bloated
Purged Tailwind CSS based stylesheets are ridiculously small. Try it out for yourself. (1)
4. Tailwind Is an Unnecessary Abstraction
Again, like I mentioned, I was even nervous that new people will not like the abstraction that Tailwind CSS has. But once you see an existing, well setup project, its so easy to check documentation and contribute. The abstraction is super thin on top of CSS.
"If it’s not already obvious, @apply completely violates Tailwind’s founding and guiding principles." - no it does not. Tailwind CSS exists to create your own style framework. It is that simple. Once you see patterns, you use @apply to codify them and reuse. That is so convenient. It is a feature in my opinion and a really important one as your project grows.
I want to stop here, but I feel that these 4 points are not strong counter points to someone using Tailwind CSS for a year over a few projects now.
(1) https://tailwindcss.com/docs/optimizing-for-production https://tailwindcss.com/docs/optimizing-for-production