Live data from Hacker News

Ways in which Tailwind CSS is a better choice than Twitter Bootstrap

frontendeng.dev

21–30 of 38 posts

Re: Ways in which Tailwind CSS is a better choice than Twitter Bootstrap

#22

If you're going to use Tailwind why not just use the style attribute and just give up on CSS classes?

People make a bunch of excuses for Tailwind. If you're going to write CSS just write CSS. Stop coping.

"If you're going to write assembly just write assembly."

Re: Ways in which Tailwind CSS is a better choice than Twitter Bootstrap

#23
I gave Tailwind a shot but ultimately settled with Bootstrap. It wasn't because Tailwind was bad-- I thought it provided a lot of value. The issues that ultimately made me switch to Bootstrap were:

1. I don't need a build tool for JS/CSS, so introducing one _just_ for Tailwind was a pain.

2. In order to really take advantage of Tailwind and speed up development, you need the Tailwind vim plugin (which doesn't work in vanilla Vim, only Neovim from what I can tell.. I don't use Neovim).

3. The html gets bloated pretty bad and it does get hard to read.. especially without the extra tooling like the Tailwind plugin to sort class names, auto complete Tailwind class names, etc.

Re: Ways in which Tailwind CSS is a better choice than Twitter Bootstrap

#24

If you're going to use Tailwind why not just use the style attribute and just give up on CSS classes?

People make a bunch of excuses for Tailwind. If you're going to write CSS just write CSS. Stop coping.

I think the word "coping" is inappropriate here, it's a tradeoff and in addition a matter of preference.

You might like not having 24000 permutations of

   display: flex;
   align-items: center;
in your code.

There are good alternatives to Tailwind and also small projects where "just write CSS" is enough. In larger projects, most people need at least strong naming conventions, other tools, and/or an opinionated "template" such as Bootstrap.

Many people using Bootstrap don't even bother to configure a theme.

That's where the real specificity wars begin then (not necessarily applicable to you).

And once people have started to define their design system in terms of overrides, pain is ahead (if you need any non-trivial CSS, that is).

After switching jobs, I now mainly use CSS-in-JS (which frees me of many problems, and in my case, creates fewer other problems).

I am perfectly versed in Vanilla CSS and the cascade, wrote my first stylesheet around 20 years ago (when layout in CSS was not really a thing)

Why is doing things differently from your preference "coping"?

Re: Ways in which Tailwind CSS is a better choice than Twitter Bootstrap

#25

Earlier quoted context omitted.

People make a bunch of excuses for Tailwind. If you're going to write CSS just write CSS. Stop coping.

I think the word "coping" is inappropriate here, it's a tradeoff and in addition a matter of preference. You might like not having 24000 permutations of display: flex; align-items: center; in your code. There are good alternatives to Tailwind and also small projects where "just write CSS" is enough. In larger projects, most people need at least strong naming conventions, other tools, and/or an opinionated "template"…

I would much prefer the explicit, vertically-legible, autocompletable and real CSS rules to a horizontal mishmash of proprietary aliases.

Re: Ways in which Tailwind CSS is a better choice than Twitter Bootstrap

#27

Earlier quoted context omitted.

People make a bunch of excuses for Tailwind. If you're going to write CSS just write CSS. Stop coping.

"If you're going to write assembly just write assembly."

The difference is that high level languages actually bring a level of abstraction not present in assembly. Tailwind does not exist on a higher level of abstraction. It's at the same level but written in a different vernacular

Re: Ways in which Tailwind CSS is a better choice than Twitter Bootstrap

#28
Based on the comments by other folks here, looks like lot of folks are using Tailwind incorrectly and then blame it for not being the right tool.

Tailwind classes might be verbose but you are not supposed to use them directly in the markup. Always create wrapper classes that are specific to your design and simply apply the utility classes in them.

In short make your own Bootstrap like framework using Tailwind's primitives. Tailwind has made this trivially simple.

Re: Ways in which Tailwind CSS is a better choice than Twitter Bootstrap

#29
post #28

Based on the comments by other folks here, looks like lot of folks are using Tailwind incorrectly and then blame it for not being the right tool. Tailwind classes might be verbose but you are not supposed to use them directly in the markup. Always create wrapper classes that are specific to your design and simply apply the utility classes in them. In short make your own Bootstrap like framework using Tailwind's primi…

This is specifically what they tell you not to do.

https://tailwindcss.com/docs/reusing-styles

Their advice is to use templating (components, partials, loops) to abstract and I agree. It ends up working a lot better than abstracting your CSS.

Re: Ways in which Tailwind CSS is a better choice than Twitter Bootstrap

#30
post #28

Based on the comments by other folks here, looks like lot of folks are using Tailwind incorrectly and then blame it for not being the right tool. Tailwind classes might be verbose but you are not supposed to use them directly in the markup. Always create wrapper classes that are specific to your design and simply apply the utility classes in them. In short make your own Bootstrap like framework using Tailwind's primi…

This is specifically what they tell you not to do. https://tailwindcss.com/docs/reusing-styles Their advice is to use templating (components, partials, loops) to abstract and I agree. It ends up working a lot better than abstracting your CSS.

I am sorry I should have written it better. This is how I abstract away from tailwinds utility litter.

https://tailwindcss.com/docs/reusing-styles#extracting-class...

Post reply on HN