Hacker News new | ask | show | jobs
by pydry 1212 days ago
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.

1 comments

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?