CommunityNews

CommunityNews

Why I don't like Tailwind CSS

You’re at a restaurant, and there’s an odd item on the menu that you’ve never heard of before, but it piques your interest. It sounds like it might be worth a try, though you’re not sure.

When the waiter approaches your table, you inquire about the dish; he notes that while most people are initially repulsed by its appearance, they should still give it a try because the chef swears that it’s supremely delicious. So, trusting his judgment, you order the dish and wait.

When your meal arrives, it looks just as unpleasant as it did in the menu. But you’re not one to judge—you’re willing to try new things. You carve into a slice of it and take a reluctant bite. And… well, it’s really not that great.

In a nutshell, this was my experience with Tailwind CSS. It’s not the worst thing to happen to CSS, but it’s certainly not the panacea that its supporters claim it is—and, in fact, it has a lot of problems…

This thread was posted by one of our members via one of our news source trackers.

Most Liked

alanq

alanq

Interesting article, some well made points but it only confirms to me that Tailwind probably is the right approach for me.

Every single approach has a trade off, and that can be presented as a criticism. But that doesn’t mean it might still not be the best approach available. Are the alternatives, whose trade offs aren’t touched on in this article, really better for a particular use case?

Maybe it’s just me, but my HTML is a bit ugly and not very readable anyway. It doesn’t feel like much of a sacrifice to have more, and initially obscure looking, html classes in it.

An example of a criticism from the article that is actually a plus for me:

you’re lying to yourself if you think this is any better than writing CSS directly, or any more maintainable than directly applying inline styles. Because instead of repeating styles in your CSS, you’re now repeating them in your HTML, through class names. In fact, you’re likely repeating yourself three, four, possibly many more times now because you can’t chain selectors.

In my workflow, NOT having to open up a CSS file at all, being able to specify the presentation directly inline inside the view template, is a huge win and avoids disrupting my train of thought. It is massively better than writing CSS directly, for me.
And I can easily use helper methods to DRY up commonly repeated sets of classes (with Ruby on Rails view helpers in my case).

Opinionated is great, but this article reads quite biased to be honest. Just a warning to anyone who reads the snippet without reading the full article and considering for themselves whether alternatives really would be better.

dimitarvp

dimitarvp

I had almost the same thoughts reading it. I was like: “wait… putting style class names inside HTML is a bad thing?” WTF? I always did it like this – I am not a frontender and I only occasionally need to write HTML+CSS (mostly for hobby projects) and to me that’s actually a good thing. As you said, less interruptions.

I’d be open to something like LESS / SASS / SCSS as well though. But IMO for most small projects any of those would be a total overkill.

malloryerik

malloryerik

I’m personally liking Tailwind. My own pain points with it (minor pain, more like aches or itches…) are around stuff like combining Tailwind’s versions of CSS Grid and Flexbox which I already don’t use frequently enough to remember without constantly checking the docs, but which require enough understanding that now I’m checking two sets of docs instead of one.

Ah, this looks nice:

Popular Frontend topics Top

PragmaticBookshelf
WebAssembly fulfills the long-awaited promise of web technologies: fast code, type-safe at compile time, execution in the browser, on emb...
New
New
malloryerik
Any thoughts on Svelte? Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue...
New
AstonJ
Here’s a pretty good list of them: https://github.com/jashkenas/coffeescript/wiki/List-of-languages-that-compile-to-JS What’s your favou...
New
michael
So I have a table of MediaItems and when that list changes, say new entries, I’d like LiveView to know about that so that the Timeline up...
New
AstonJ
If you know of any good learning resources for Svelte please post them here :smiley: Here’s some to get us started: The official tutori...
New
First poster: bot
Tailwind CSS Tools For Developers. A collection of tools designed for developers, to save you and your team time when building websites w...
New
First poster: bot
WebAssembly-Powered FM Synthesizer. An 8-operator, polyphonic FM synthesizer running completely in the web browser via Rust compiled to ...
New
First poster: bot
Tailwind v2.1.0 has been released. Link: Release v2.1.0 · tailwindlabs/tailwindcss · GitHub
New
mrmurphy
The situation Hi there! I’m working on a live view app right now that encrypts sensitive user content (text and images) using the browser...
New

Other popular topics Top

Devtalk
Reading something? Working on something? Planning something? Changing jobs even!? If you’re up for sharing, please let us know what you’...
1016 16836 371
New
AstonJ
Or looking forward to? :nerd_face:
New
Exadra37
Please tell us what is your preferred monitor setup for programming(not gaming) and why you have chosen it. Does your monitor have eye p...
New
siddhant3030
I’m thinking of buying a monitor that I can rotate to use as a vertical monitor? Also, I want to know if someone is using it for program...
New
AstonJ
There’s a whole world of custom keycaps out there that I didn’t know existed! Check out all of our Keycaps threads here: https://forum....
New
Exadra37
I am a Linux user since 2012, more or less, and I always use Ubuntu on my computers, and my last 2 laptops have been used Thinkpads, wher...
New
AstonJ
Do the test and post your score :nerd_face: :keyboard: If possible, please add info such as the keyboard you’re using, the layout (Qw...
New
PragmaticBookshelf
Author Spotlight Jamis Buck @jamis This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
New
CommunityNews
A Brief Review of the Minisforum V3 AMD Tablet. Update: I have created an awesome-minisforum-v3 GitHub repository to list information fo...
New
AstonJ
This is cool! DEEPSEEK-V3 ON M4 MAC: BLAZING FAST INFERENCE ON APPLE SILICON We just witnessed something incredible: the largest open-s...
New