Hacker News new | ask | show | jobs
by beezlewax 1212 days ago
Refreshing to see someone else who hates Tailwind. It's a nightmare.
4 comments

Haha, I love Tailwind and Tachyons! Writing CSS is still a PITA.
The worst Tailwind I've seen is HTML littered with a, a:hover etc. declarations on every hyperlink. OK, you can create a global Tailwind stylesheet in your config but doesn't that defeat Tailwind's purpose?
According to Adam Wathan himself in 2020, yes, it does:

https://twitter.com/adamwathan/status/1226511611592085504

Oh, and that's discounting responsive breakpoints. So if you have 3 of those that can be 3 lots of a, a:hover etc. for every hyperlink. You couldn't make this up.
What do you prefer & why?

As a somewhat outsider to CSS I look at tailwind and don't feel excited but I do wonder if thats as good as it gets.

I prefer CSS. We even have browser support for CSS variables now so what else do you need? Tailwind wipes out half of the features of CSS and replaces them with mindless inline repetition and bloat all in the name of convenience. I call it inconvenience and refuse to work on Tailwind projects.
> We even have browser support for CSS variables now so what else do you need?

Not writing CSS in a different file and have it applied to all my page would be a start. Creating a class for each different component and then writing CSS for that component is not really great. I like the Svelte way where you have your components that have HTML, CSS and JS, and some global CSS too.

> Not writing CSS in a different file and have it applied to all my page would be a start.

Are you saying you do or don't want CSS in a different file? You can have whichever you please. You can put your CSS in style tags on an html document if you want, or use javascript to inject a style tag wherever, that you can write inside a template string, I guess. Depending on whatever templating language system you're using, you can put css in that language's version of style blocks, such as in React or Vue I've seen .jsx or .vue files with blocks of styling code in them (usually just option 2 above with sugar, using js to inject a style tag).

> Creating a class for each different component and then writing CSS for that component is not really great.

You can use CSS variables and basic rules to combine styles if you'd like? I'm not exactly sure what you mean. I mean, the styles cascade, what are you trying to accomplish that can't be done easily by using a universal rule to apply some baseline fonts or what have you?

From what I can tell, this is a very common take. Especially on this site.