Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> So tailwind at this point is basically just a bunch of custom CSS classes which are granular to the point of single CSS properties?

It pretty much always were?

> How is that better, than just writing custom CSS classes for components + having some util CSS classes?

1) colocation of style and layout in the code (no separate file, no "dead-code" CSS classes) 2) isolation of styling rules (this style applies ONLY to this HTML component) 3) Built-in standardization across the codebase (spacing, colors, etc)

Only works well in component-based web development (ie React, Svelte, Vue, etc) as opposed to inheritance-based styling (old school CSS+HTML)

You can get a lot of the benefits of tailwind using other tools like CSS modules (isolation) or colocation (styled-components), or with plain CSS features (CSS variables for standardization). But tailwind has a major benefit of introducing almost-zero runtime impact (vs styled-components) and having everything already built-in (vs css-modules. There is very little the user of the lib needs to think about architecture-wise when using tailwind



> Only works well in component-based web development (ie React, Svelte, Vue, etc) as opposed to inheritance-based styling (old school CSS+HTML)

Funny how that's not how it's advertised on the landing page. The first animation of its use is just basically plaintext HTML document.

I can't imagine using it for that.


It is on the landing page. Roughly halfway down. That said, that hero example would be impossible to show in anything other than plain HTML as you would need a react version, an Angular Version and a Vue version. It is a demo of what it can do rather than than how.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: