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

or to the point, how is this different from just using `style=` attributes?

One of the big reason to not do that in the past was in order to disconnect the presentation from the page structure, but if you have individual classes for each individual css property, you're back at tying the two together.

What am I misunderstanding here?



You can’t do things like hover styles, media queries, etc. with `style=`.

Re: separating presentation from page structure, Tailwind is designed around the opinion that that whole idea was mostly wrong, similar to how frameworks like React brought back the `onClick=` attribute when everyone was saying “unobtrusive JavaScript” was the best practice

Wrote about this in depth a few years ago shortly before releasing Tailwind, can read here:

https://adamwathan.me/css-utility-classes-and-separation-of-...




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

Search: