Live data from Hacker News

Tailwind Isn't for Me

spicyweb.dev

41–50 of 191 posts

Re: Tailwind Isn't for Me

#43
post #10

I love tailwind. I strongly feel that most modern CSS solutions are massively overthought. In engineering we have bigger problems to solve than a key/value list that makes a div blue. Tailwind removes the thinking around CSS, naming, preprocessors etc etc, it just lets me write good CSS and focus on components and other engineering problems. I seem to be one of the few people who can read CSS properties horizontally…

My biggest issue with Tailwind is point #5 on the article: Tailwind encourages div/span-tag soup. Together with the class name soup my HTML becomes unreadable.

> HTML becomes unreadable

To be honest, I don't find that a problem. Most frontend development is done in a higher-order abstraction like React. For the most part, I don't read HTML and I don't write HTML. If you use the right level of composition, "div soup" should never really be a problem.

Re: Tailwind Isn't for Me

#44
I can't understand why people bother about HTML with long class attributes so much. If you use "btn" instead of a long string of Tailwind classes, you just move the actual CSS properties into a stylesheet file, which you need to switch back and forth to just to change the looks of that button.

And having said that, when using Tailwind with some kind of component-centred framework, those classes will be local to a component anyway, which is exactly the same as some kind of custom component the author praises (that also needs styles within.)

Re: Tailwind Isn't for Me

#45
Decent arguments. Ultimately, I think your preference comes down to:

- Do you care about how your html output looks? - I personally don't, just like I don't care about what my Webpack bundle looks like. Web standards will always be slower to evolve, which is why we build tooling on top.

- How do you think web components will be used? - I believe they will be used sparsely, only by libraries. But if you want to replace your frontend framework (I currently don't see why), Tailwind will not work.

We've opted to work with CSS Modules (which give you many of the Shadow-DOM advantages), but I would be lying if I didn't see the appeal of Tailwind every day. For me, it's the redundancy of having to give semantic names to elements that are already described by their React component names.

Tangentially, developers often are tempted to use classes for things that should be components. CSS classes must not be used for code reuse on a large scale, because CSS and HTML are bidirectionally coupled and you will end up search-replacing large sections of html because the design team wanted the text to align in a way that is somehow impossible without adding a div.

Re: Tailwind Isn't for Me

#46

Tailwind is an abomination. Of course it's easier to use. Pressing the bold button in MS Word is easier than setting up styles etc, but one makes it easy to create an impossible to maintain mess that could have been made by a primary schooler, and one makes it possible to create a consistent style that looks professional. The only reason I think Tailwind is becoming popular now is it's exposing a bunch of things like…

Tailwind is opinionated, meaning it encourages a structure that helps devs avoid common potholes.

You may not like its choices but saying it creates a mess has been the opposite of my experience.

One of the main pitfalls I have noticed no longer running into is that the structure tailwind encourages prevents issues with CSS selector specificity. As a result I’ve definitely noticed fewer instances of ‘!important’ in code review.

Re: Tailwind Isn't for Me

#47

> We live in a world where custom elements (aka ) are fully supported and enabled by modern browsers. Don't we need to define the custom element using javascript first? All my knowledge about custom elements comes from this Mozilla doc: https://developer.mozilla.org/en-US/docs/Web/API/Web_compone... If custom elements is the way to go, it sounds like a lot of javascript and coding overhead that I have to take. Doesn'…

You can use custom tags just like any other native tags without any js, they just work

Re: Tailwind Isn't for Me

#48

> We live in a world where custom elements (aka ) are fully supported and enabled by modern browsers. Don't we need to define the custom element using javascript first? All my knowledge about custom elements comes from this Mozilla doc: https://developer.mozilla.org/en-US/docs/Web/API/Web_compone... If custom elements is the way to go, it sounds like a lot of javascript and coding overhead that I have to take. Doesn'…

Depends on what you're going to use them for. If you need the actual JS functionality web components can offer, then yes. Though at this point you're in JS land anyways and probably using some kind of web component library (or your custom-built helpers/wrappers/etc.), which usually handles this for you.

If all you want to do is prevent the "div/span-tag soup" as he calls it, you don't have to register anything, though. You can just write My header and style that using regular CSS à la ui-card { background-color: red; }.

Re: Tailwind Isn't for Me

#49
post #25
post #10

I love tailwind. I strongly feel that most modern CSS solutions are massively overthought. In engineering we have bigger problems to solve than a key/value list that makes a div blue. Tailwind removes the thinking around CSS, naming, preprocessors etc etc, it just lets me write good CSS and focus on components and other engineering problems. I seem to be one of the few people who can read CSS properties horizontally…

Why not Styled Components? I've been using them for years now and I'm extremely productive. Tailwind on the other hand looks like a hellish nightmare, horizontal reading, proprietary syntax, no selector targeting of other components.

If horizontal reading bothers you so much it resembles a hellish nightmare (Dante would like to have a word with you), nobody stops you from going like this:

  Submit
And you actually can target other components. There are lots of sibling selectors, including named groups:

  
    
    Name
  

Re: Tailwind Isn't for Me

#50
I hated tailwind with a passion at first glance. I thought it looked horrible and while it still does, I decided I don't care.

After a while of using Tailwind at work, I have started to love it. It it just so much more productive and I rarely need to step into css-land anymore. You still need to know and understand how CSS works in order to get the most out of Tailwind.

Tailwind is just like CSS but with shortcuts ready there for you to use.

Post reply on HN