Live data from Hacker News

Working with Tailwind CSS every day for 2 years

themosaad.com

21–30 of 215 posts

Re: Working with Tailwind CSS every day for 2 years

#21

I'll be honest here, after working with tailwind for 7 months I really hate this piece of tech and really regret picking this company. I thought it wouldn't be a big deal but after seeing unnecessary long walls of class names I'm really tired. Anything other than basic styling is an absolute pain with tailwind and I don't understand why /my company specifically/ can't just use typestyle/styled-components/css modules…

interesting take! I started using tailwind with the classnames library early on and found it to be a really nice fit for my purposes. Also very interested in more tailwind-specific tools like tw-classed[1]

[1]: https://tw-classed.vercel.app/

Re: Working with Tailwind CSS every day for 2 years

#22
I hate Tailwind with the passion of a million suns. It's loved by novices and those who don't know what they're doing, almost exclusively. They claim they know CSS, but will fail after any casual test.

The best arguments against it:

1. Spamming utility classes causes horrible git commits, git history, git difference checks;

2. Conflicting utility classes aren't clear, and sometimes the order cannot be trusted;

3. Replacing `p-4` with `p-4` will require you to replace its occurrence all over your app, sometimes affecting thousands of matches. And since there is no context to it, it'll be hard to JUST replace them where you would want them to.

Vanilla CSS using `:root` declaration, a fixed base size (using `rem` and `em`), CSS variables and `calc()` are SO powerful.

In almost every single use case, using vanilla CSS or SCSS is far superior. For React projects (and Vue.js, and Svelte, and Angular), I'd recommend anyone to just use (S)CSS modules. It's so elegant and doesn't come with any of the disadvantages.

Except maybe a slightly larger package size. Minimally so. Your framework of choice should be (or allow) code splitting to take place. And a few bytes more or less aren't going to make or break most websites.

Re: Working with Tailwind CSS every day for 2 years

#23
Oh two tailwind hate threads today instead of the usual one at a time?

Everyone as usual saying "long class lists" even though the literal home page tells you not to do this and to make components or partial views or whatever your tool of choice calls it.

At least be inventive and follow the instructions before you start blaming something.

Re: Working with Tailwind CSS every day for 2 years

#24
post #3

I don't like Tailwind, except for pure layouting where it truly shines. My belief is this: we should think of layouting and styling as two distinct concepts and it doesn't help that CSS is used for both. After years of experimenting with various CSS approaches, I believe using Tailwind for layout and styled-components for styles is the ultimate setup for React applications.

Same feeling here.

In Tailwind, I'll use a `p-3` or a `.flex.items-center` all day, but making a nice button is such a slog, since I'm coming from a Vuetify background.

Vuetify also has the same layout classes as Tailwind, like `pa-3` and `.d-flex.align-center`

I use Vuetify + Pug (instead of raw HTML templates), so I get to make buttons like this:

    v-btn(outlined color="accent" @click="handleClick") Do Stuff
or a Data Table with, say, a custom-formatted UPC column, like this:

    v-data-table(:loading="loading", :items="items", :headers="headers", :items-per-page="50" dense).my-3
         template(v-slot:item.upc="{ item }")
              span {{formatUpc(item.upc)}}
(I like to separate attributes with commas, which is valid pug but invalid HTML)

Sure, I could get something like TailwindUI, but their components are walls of divs and classes that each take half an hour to load into my head to visualize what's creating all the combos of states (regular, hover, focus).

So my Vuetify + Pug approach works great for greenfield projects that I create.

But if I'm downloading a nice template for a side project, say from Cruip.com, it's not like they're going to use the same build chain as me, and they do have to settle on a standard CSS library, so they default to Tailwind (just like 5~10 years ago they would have defaulted to Bootstrap).

Re: Working with Tailwind CSS every day for 2 years

#25
post #13

I'll be honest here, after working with tailwind for 7 months I really hate this piece of tech and really regret picking this company. I thought it wouldn't be a big deal but after seeing unnecessary long walls of class names I'm really tired. Anything other than basic styling is an absolute pain with tailwind and I don't understand why /my company specifically/ can't just use typestyle/styled-components/css modules…

I have the same thought. Bootstrap is still my favorite choice.

Yeah, I used Bootstrap for a long time, and got used to how it works.

I wanted to like Tailwind, but it seems a bit disingenuous. It's like using inline style tags, just with shorter names.

From time to time I've made an effort to learn how CSS works, but after a while I forget the details. It's more productive if I can browse a catalogue of visual examples, with concise markup that is easy to copy and paste.

Bulma seems like the more "modern" take on Bootstrap: https://bulma.io/

Re: Working with Tailwind CSS every day for 2 years

#26
Tailwind certainly has some advantages and nice features, but the length of the class string when you need something common but complex like a custom styled checkbox including focus states, various hovers, media-queries, etc gets absurd and far more difficult to read, debug, and update.

I think one of the primary reasons Tailwind is so popular is how poorly React deals with classes and styles. In other frameworks/libraries like Vue/Svelte CSS is treated as a first-class citizen with a lot of nice quality-of-life improvements that React teams are forced to implement using awful CSS-in-JS solutions or with Tailwind. You get single-file-components, scoped styles, etc, all out of the box and without having to learn a new abstraction.

If the dev world wasn't a React monoculture (and more devs appreciated CSS deeply) I think you would see significantly less interest in Tailwind.

Re: Working with Tailwind CSS every day for 2 years

#28
post #4

I have been working with HTML since I was 11 — 20ish years. I thought I knew most things. text-decoration-thickness? Nope. I have been adding border-bottom to spans for far too long it looks like.

no problem. I work every day with CSS ... you can't know every new feature unless you have at least one use case to get know the new feature. The "old" technics are still working but if you want the benefits of new technics like text-decoration-skip-ink you have to use the new ones. So as long as you do not run into such problems like "skip-ink" you do not have to learn ne new ones.

Re: Working with Tailwind CSS every day for 2 years

#29

I hate Tailwind with the passion of a million suns. It's loved by novices and those who don't know what they're doing, almost exclusively. They claim they know CSS, but will fail after any casual test. The best arguments against it: 1. Spamming utility classes causes horrible git commits, git history, git difference checks; 2. Conflicting utility classes aren't clear, and sometimes the order cannot be trusted; 3. Rep…

It's loved by novices and those who don't know what they're doing, almost exclusively.

I've been a frontend dev for 25 years and I quite like Tailwind. I'm not sure which category I fit into. I think it might be both.

Replacing `p-4` with `p-4` will require you to replace its occurrence all over your app, sometimes affecting thousands of matches.

This is a really good example of where Tailwind is actually quite nice. Imagine if you didn't use a utility class, and instead you'd written your styles in plain old CSS or SCSS with "padding: 8px;" everywhere on your years-old-built-up-to-thousands-of-styles design. Replacing those is easy enough, but what about your SCSS mixins? Your CSS calc()s? The places where someone thought an element needed a bit more padding and used "padding: 9px" instead? Manually managing styles is hard. Tailwind makes it a bit easier, mainly because it encourages consistency and removes variability. Finding and replacing a "p-4" everywhere is trivial, and if you've used a library well rather than rolling out an ad hoc mix of things you can be quite confident your change will work everywhere. It's far from perfect but it's quite a well-thought out approach.

Re: Working with Tailwind CSS every day for 2 years

#30

Oh two tailwind hate threads today instead of the usual one at a time? Everyone as usual saying "long class lists" even though the literal home page tells you not to do this and to make components or partial views or whatever your tool of choice calls it. At least be inventive and follow the instructions before you start blaming something.

If everyone using a tool is using it wrong, it’s a poorly designed tool
Post reply on HN