Live data from Hacker News

Tailwind Isn't for Me

spicyweb.dev

91–100 of 191 posts

Re: Tailwind Isn't for Me

#91
post #84
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…

> most modern CSS solutions are massively overthought Example is Tailwind. Which in the end is same as inline CSS.

This is false and people need to stop parroting it..

Inline styles have high specificity and are often the culprit of specificity clashes.

Inline styles don't follow a design/theme, tailwind has sensible defaults for spacing/colours and consistency etc.

Inline styles are even more verbose than a tailwind class list.

Tailwind has responsive classes out of the box.

Inline styles don't really support pseudo classes....

Re: Tailwind Isn't for Me

#93
post #9

Yeah, it isn't Tailwind that doesn't support web components. It's Shadow DOM that is such a bad abstraction that it breaks the web in innumerable ways and need dozens of new standards to fix its shortcomings.[1] And yeah. That that is seemingly not an eyesore? It's not because Tailwind is bad and "pollutes HTML". It's because web components hide any and all ugliness from you so that you can pretend they are beautiful…

I'd like to like web components, but their reliance on JS to instantiate along with all the chaos of the shadow DOM keep them off the table for me. I think they are a great concept defeated by the implementation.

google "html web components"

Re: Tailwind Isn't for Me

#94
post #2

Especially in the HTMX community I'm alwayws wondering why people are chosing Tailwind. I tried it too and had the same problems as stated in the article. Mainly that its polluting the HTML so much. I went the opposite route and am using PicoCSS now which works with semantic tags and can even work without any classes. Feels much cleaner

Locality of Behaviour: "The behaviour of a unit of code should be as obvious as possible by looking only at that unit of code" https://htmx.org/essays/locality-of-behaviour/ Some people want "cleaner" and that's fine, I much prefer things to be "right there" as much as possible. Must be how my brain works

Also known as spaghetti code.

Re: Tailwind Isn't for Me

#95

Disclaimer: I’m extremely newbie in front end, probably less than 6 months of experience combined in the last 6 years. I can’t stress enough how easy it is using Tailwind, it just works! I don’t care about the long ass lines because for how I’m used to format html pages, I’d have to go to a new line anyway, it’s just that now I can understand what’s happening in react components without too many troubles. Another plu…

I don't quite get the hate for having CSS in another file. Do you also put all your react stuff in one single file ? That same logic and argument can be applied against all modularization.

And really 20-50 tailwind classes in a single element is VERY hard to read and keep in mind. No - it does not make things clear or understandable. One tends to need to re-read and scan over from the beginning and eyes glaze over. Esp if some elements only vary with a few classes missing. I guess it works for people with very high attention to detail and high amount of working memory. I only find it personally frustrating. With a CSS class applied to that component, one at-least has a singular NAME to refer to that piece of composite styling and your memory can be used for other matters.

Maybe tailwind css works well for some bright, big-memory developers. I did try it for a couple of projects, including needing to maintain someone else's tailwind project - and only felt stupendous pain.

However, the "atomic css" philosophy behind tailwind is great. I find frameworks like https://open-props.style/ a far better application of that principle.

Re: Tailwind Isn't for Me

#96
post #56
post #5

I feel the same about javascript: "I think the folks building Tailwind are talented and nice people. But at a pure technical level, I simply don't like Tailwind. Whoever it was built for, it was not built for me."

What would you suggest as an alternative to enable rich web applications?

Tailwind is just a way of writing/architecting CSS. There is nothing in it that "enables" rich web applications which browsers doesn't let you do with (vanilla) CSS, at the end it's just using CSS under the hood (utility classes). And CSS is not the alternative to Tailwind; there are numerous ways to write/architect CSS and Tailwind is just one of them, very opinionated and rigid that you should follow it's way of doing it. But you don't need any specific tool to write CSS, that's the point of the article.

Instead of learning/memorising CSS properties and values, you learn and memorise Tailwind classes which are just abstractions to regular CSS properties and values and you need to write them inside class tags. I think the lure of Tailwind comes from IDE integrations and its documentation. But it doesn't add any "new features" that enables rich web applications which CSS lacks in anyways.

Re: Tailwind Isn't for Me

#97
post #56

Earlier quoted context omitted.

What would you suggest as an alternative to enable rich web applications?

Tailwind is just a way of writing/architecting CSS. There is nothing in it that "enables" rich web applications which browsers doesn't let you do with (vanilla) CSS, at the end it's just using CSS under the hood (utility classes). And CSS is not the alternative to Tailwind; there are numerous ways to write/architect CSS and Tailwind is just one of them, very opinionated and rigid that you should follow it's way of do…

Please reread my comment per OP referring to JS, not Tailwind :)

Re: Tailwind Isn't for Me

#98
post #79
post #70

Earlier quoted context omitted.

It's a fairly limited set of rules that are mostly consistent, extensively documented, and easy to remember. But yeah, a little bit of effort is required when dealing with a styling language with over 300 properties. Without Tailwind, you'll have to come up with a unique, declarative, distinctive name for each and every element you're piling styles upon. At first it's a button, then there's buttons that should look l…

> Without Tailwind, you'll have to come up with a unique, declarative, distinctive name for each and every element you're piling styles upon I can honestly say I've never spent more than 5 seconds thinking about what to name a styled component, do you really get decision paralysis with this?

This isn't about decision paralysis, but picking good names that other people will understand. But they won't, not all of them at least. No matter how great you're at naming things, you are going to do it differently than other people do. That doesn't matter on your personal home page, but it breaks down with a larger team. Inevitably, naming principles will drift apart, and after a few years, you'll have a mess. Don't believe me? Read the myriad of blog posts of development teams coming up with new CSS frameworks or migrating from one to another, to combat this.

Tailwind removes the naming ambiguity here, by moving away from naming things to describing the styles in a composable way. Drop your new hire in the code base, give them access to the Tailwind docs, and they'll be productive immediately (even more so if they previously spent half an hour with it).

Re: Tailwind Isn't for Me

#99
post #61
post #48

Earlier quoted context omitted.

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, thoug…

You... Can't. You literally cannot define a custom element without Javascript.

You don't have to define it, though. Browsers are supposed to just put unknown elements in the DOM and style them like any other element, using CSS.

Re: Tailwind Isn't for Me

#100
post #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 com…

“Need to switch back and forth” is a strangely negative way of putting it. Do you “switch back and forth” to a function definition, and is that an argument for procedural code and repetition?

Then your second paragraph is a great point against the need for Tailwind and the long class attributes, as you’re going to encapsulate all of that in a component (and “switch back and forth” to see its styles) anyway.

Post reply on HN