top | item 31692726

(no title)

fleaaa | 3 years ago

Am I only one that feeling like code readability is a bit gross?

discuss

order

quickthrower2|3 years ago

Plain HTML yes.

Using a web framework? No.

It is clever in that half of it is missing: the componentisation that React (etc.) brings with it makes this shine.

You can also define normal CSS classes based on the utility classes if you so wish.

Tailwind after 4 hours of learning curve is so much nicer than cutting css or using old skool css frameworks. Some of that is because ready designed components exist that you can copy.

With an old skool css framework once you hit an edge case you can be snookered and spend ages diagnosing why because of some clever stuff they done.

Tailwind says “yeah css was a bad idea, let us abstract it away a bit” and does a nice job.

LordHeini|3 years ago

Yep but unfortunately the "classic" way of writing CSS does look equally awful after some time with multiple people on a larger project. The html is cleaner but the CSS becomes an awful mess.

The moment the first important! or inline stuff creeps into the page you are doomed. Utility frameworks feel a bit like giving up at the start and just rolling with it.

The major problem i see with these frameworks is that it is harder to maintain a consistent style across teams or even a few devs.

andix|3 years ago

Usually you build reusable components with tailwind, so that you archive DRY. With React for example (or any other technology).

The huge benefit is, that you don’t split up HTML and CSS, you only write HTML.

jonwinstanley|3 years ago

At least with a Tailwind attribute you know what you are getting.

A named CSS class can contain any definition and even if you are certain of those definitions, they can change depending on what the element is contained within.

dgb23|3 years ago

You use refactoring/code structure techniques just like with regular code. Group stuff into components that belong together, use sensible names etc.

The cost of tailwind is that you do a bit of upfront work, when defining your design system/tokens in their config. The benefit is high default performance (css is less bloated) and high productivity because you tend not to switch to CSS/SCSS and get a natural DRYness from working with it.

cglace|3 years ago

But ergonomics are so much better. I’ve seen my team increase throughput dramatically after switching to tailwind.

danielvaughn|3 years ago

I’ve used Tailwind in quite a few projects at this point. It’s a bit gross, yeah. But overall that’s a small price to pay for all the benefits it brings.