logoalt Hacker News

vazarktoday at 2:35 PM6 repliesview on HN

IMO, Tailwind is just inline CSS with standardised defaults. I think it found its place because most React devs didn't want to bother with CSS


Replies

tiborsaastoday at 5:48 PM

It found its place because working on CSS on any non-trivial scale with multiple engineers is painful. The best way to deal with CSS at scale is not to write CSS. And this comes from me who really likes CSS.

gherkinnntoday at 3:39 PM

Oh why can't this idea die, it has been continuously debunked for 6 years now. So much so, any TW discussion will reiterate it.

show 2 replies
eudamoniactoday at 4:42 PM

It is used because UI component frameworks make vanilla CSS an awkward an unnecessary tool (the Cascading part). CSS makes sense as designed for styling a document, but not so much for styling atomic components. If we were designing the web and CSS from scratch around the React model, CSS would not be made to cascade, because that is totally unnecessary and usually leads to more issues than it solves. Apart from theme variables, in a component system there's no reason to have global CSS anywhere; you'd just style each component in isolation. So when in the React model you typically want no cascades at all, the library that is made for that gets popular.

CSS modules are also a solution to the above, but, once you get rid of cascading, and you have one stylesheet per component, it is again unnecessary to have the one stylesheet in a different file from the one component. There's no benefit to splitting a component and its styles into two files; it just makes it more annoying to edit. So we move the styles essentially inline, with either Tailwind or CSS-in-JS.

show 1 reply
davidwtoday at 4:31 PM

That, plus it looks like Forth code

    grid dup 1.0 scale wind-x drop cols-4
cute_boitoday at 3:00 PM

I think it is mostly backend dev who don't want to spend time in frontend stuff.

wuhhhtoday at 3:00 PM

[dead]