Live data from Hacker News

I don't recommend Tailwind CSS

en.andros.dev

121–130 of 179 posts

Re: I don't recommend Tailwind CSS

#121
post #69
post #66

Earlier quoted context omitted.

It’s funny, as someone that’s been using CSS for decades I don’t really know how to respond because the scenario outlined here is not one I recognise. My button would be a , so no, I wouldn’t have a .button class, it’s superfluous. What I would have is: - a global palette specified via CSS variables - overrides for dark mode etc specified at the global level so I don’t have to worry about it at the component level -…

You just make a design system in your tailwind.css, following the documentation. You can optionally use something like daisyui if you do not have designer skills or the time. That handles consistent sizing, spacing, text, colors, dark mode, and anything else your design system needs. It all compiles down to css in the end, so no runtime overhead and gives you the superior tailwind dx during development.

We are stuck with CSS, but all these CSS styling frameworks just tell me CSS needs to be bulldozed. I looked up DaisyUI that you mentioned. The example on the home page gets rid of chained classes and replaces them with one:

// Styling a simple button daisyUI Button

So, we are back to regular CSS?

Re: I don't recommend Tailwind CSS

#122
post #88

Earlier quoted context omitted.

they do work… for any value of work . I have been in the industry for a while, and I've never seen a project which doesn't slowly devolve into fights with the cascade over time - arbitrary abstraction layers, ad-hoc organization patterns, developer-specific conventions, inconsistent naming, and so on. All of this usually creeps in the more a project grows. At some point, someone adds postcss or scss or another prepro…

> I have been in the industry for a while > Out of curiosity how long have you been doing frontend development? I've been writing CSS since IE 6 and I can tell you not a lot of us oldies like tailwind. I've only seen a strong inclination towards Tailwind from the newer generation frontends (2015 and beyond) Us oldies actually prefer BEM over anything else. My talking point is based off internal comms from a large'ish…

Many of us oldies who started working on the web years before IE 6 actually like Tailwind. We all have our preferences. But I know multiple 50+ year olds who have been doing this work since CSS was barely a proposal who now use Tailwind.

Re: I don't recommend Tailwind CSS

#123

Earlier quoted context omitted.

It makes no sense for me that @apply is frowned upon. It's what makes Tailwind actually kinda usable for me. Without it, markup looks like line noise full of boilerplate that's hard to modify in a systematic way. I think what Tailwind actually needs is more abstractions, not to discourage the use of the sole abstraction @apply

I genuinely don't understand, why would you use `@apply text-center` instead of `text-align: center`? Like if you're already at the point of setting up stylesheets & classes with a pre-processor why would you do that and not say use scss with some mixins for the more complex reused parts? At that point any IDE plugin that knows CSS can give you completion and your compiled sources will look a lot like the written one…

Personally I wouldn't use `@apply text-center` over just `text-aligh: center;`, but I do use `@apply text-red-300` or `@apply px-2`, simply because I like the set of defaults Tailwind comes with.

I tried building my own set of defaults, but eventually decided that just using the Tailwind ones is much easier.

Re: I don't recommend Tailwind CSS

#124
> .red-color{

> color:red

> }

> .big-text{ font-size:20px }

My theory is that higher-level abstractions don't need to add any value to be popular, you can just create a single dependency that abstracts away one lower level dep, and people will use it only because they want to avoid learning something, in the end they will actually learn the thing with a proxy in the middle, but at least they took a shot at skipping the 'grind' of learning css.

Re: I don't recommend Tailwind CSS

#125
post #7

As a 26+ year frontender, years ago I was against it on so many levels. Until I tried it. Never looked back. Also, inheriting projects with someone else’s code is fine. Just a quick look at the central config and you’re good to go.

I felt the same way with JSX. Started using it and don't want to look back. Same with Tailwind.

Re: I don't recommend Tailwind CSS

#126
People tend to overlook the main benefit of Tailwind: components and pages become self-contained. As such, changing them doesn't cause unintended side-effects to other pages and all or parts of a component can be dropped into another page and it "just works." This is a huge benefit as the normative/intended behavior of CSS makes changes risky on large sites. Now, there are other ways to do this, but Tailwind is quite effective at it.

Re: I don't recommend Tailwind CSS

#127
After trying a Tailwind-adjacent library myself (UnoCSS) I came to the conclusion that it's awful, but it's the least awful among worse alternatives. Having gone through BEM, I have no desire to go back there. Layers, modules, and scoped CSS seem like they could address a lot of the pain points in semantic CSS that TW was trying to, but I've never used any of those in anger save for Vue's emulation of scoped CSS.

Re: I don't recommend Tailwind CSS

#129
Ergonomics for hand composition are less relevant now. The most important trait is how does a long-lived project perform when written by a coding agent.

I’m curious if anyone has any takes on the different approaches to agentic styling.

I’ve tried Tailwind for this without further steering, and after a while the agent starts adding unnecessary utility classes everywhere. Then I taught it to micro-Ralph eval all its utility classes using screenshots and this works ok but burns a lot of tokens. Treats the symptom and not the problem IMO.

Maybe with the right set of constraints there’s a subset of Tailwind that composes better? I went back to vanilla CSS for now, on the hope that it will readily port to whatever the best thing ends up being later.

Re: I don't recommend Tailwind CSS

#130

The problem isn’t tailwind, it’s css. It always has been css. That being said, it’s a hard problem and I don’t have a better idea. Tailwind seems to at least fix or move the problem in the right direction.

Every technology is going to have a problem, if you install something new, you'll have to discover the problems, if you use the standard tech stack, you will know exactly what the problems are.
Post reply on HN