3 ms·
I used tailwind for my site and ended up liking it a lot, but maybe for reasons that are not often mentioned? The real value of tailwind is being able to read a
by asimpletune 2y ago
I used tailwind for my site and ended up liking it a lot, but maybe for reasons that are not often mentioned? The real value of tailwind is being able to read all the styles that affect a an element in one place. Sure the classnames can get long, but it’s still a lot faster to read that long line, than open the browser tools each time or scroll up and down one (or many) stylesheets.
Then when you come back to that code later, you can confidently edit it without worrying about causing changes to other elements.
The cascading nature of CSS is still helpful, but I find that I usually want to limit my styling to just one element. For all the rest I go back to css but I wrote very little css because I usually just want to get the whitespace right.
- topicseed 2y agoI kind of agree but the same problem exists. If you add text-xl to a div and have nested divs and spans, they'll all be inheriting text-xl so for these nested elements, you also have to look up the element's lineage to find what's causing the text-xl. But overall it's a bit easier yes.
- javier123454321 2y agoThat's the css cascade, not a tailwind issue.
- jitl 2y agoI think that is exactly why tailwind is good and nice. Although I also like that it makes “how do I do X?” a quick doc search instead of a 30 minute research project
- twelve40 2y ago> real value of tailwind is being able to read all the styles that affect a an element in one place there are helpers for that in the IDE (e.g., "Show Applied Styles for Tag" in Intellij) or even in chrome dev tools that show all this in a readable way. Tailwind snippets mentioned in this HN topic look kind of scary in comparison.
- asimpletune 2y agoThe difference is with tailwind that information is stored as text in source control. So you can parse it with nothing but your eyes in GitHub or by looking at a diff, without relying on any extra tooling.