Tailwind: A Utility-First CSS Framework
11–20 of 106 posts
Re: Tailwind: A Utility-First CSS Framework
#12I personally have an issue with this "Utility/Functional" CSS pattern. To me I still think that the good old "HTML describe how the content is organized, CSS describe how this content looks like" is the way to go. In the end it's how CSS and HTML were designed at first. But when I see that I'm sorry but it just doesn't feels right to me.
Yes, the problem is that this library just replaced typing with without realizing that the first is considered a bad practice for a reason and that the second is equivalent.
Not quite, for a few reasons:
Inline styles don't respect media queries, which basically rules out responsive design
Inline styles aren't limited to pre-defined options, meaning you can still end up with 90 different shades of blue)
Inline styles cause specificity issues, since they trump separate stylesheets.
Inline styles don't support print-specific styles.
Inline styles can't address pseudo-elements (such as ::before and ::after)
Inline styles can't apply to multiple elements. Utility classes can define .bg-blue once and have it apply to many things, which leads to shorter markup and quicker rendering speed.
Inline styles are a pain to type. Compare class="f-sm bg-blue" to style="font-size: 10px; background-color: #0000ff;".
Utility classes fix all of these things.
Re: Tailwind: A Utility-First CSS Framework
#13The practical dev workflow of using tailwind is a breath of fresh air.
Coming back to old projects with bespoke CSS is SO PAINFUL to edit/change compared to something built in Tailwind.
You absolutely also have the power to make css components/abstractions as well.
Re: Tailwind: A Utility-First CSS Framework
#14I personally have an issue with this "Utility/Functional" CSS pattern. To me I still think that the good old "HTML describe how the content is organized, CSS describe how this content looks like" is the way to go. In the end it's how CSS and HTML were designed at first. But when I see that I'm sorry but it just doesn't feels right to me.
https://adamwathan.me/css-utility-classes-and-separation-of-...
Re: Tailwind: A Utility-First CSS Framework
#15You really do have to try it to shake that impression.
If you need a bit more convincing before you're willing to try it, I wrote an in-depth article a while ago that documents my journey from a "semantic classes"-loving HTML/CSS purist to a utility-loving heathen:
https://adamwathan.me/css-utility-classes-and-separation-of-...
If you want to watch it in action, here's a screencast where I rebuild the Netlify UI in an hour and a half without writing any custom CSS:
https://www.youtube.com/watch?v=_JhTaENzfZQ
...and if you want "social proof", here's an interview I did with Diana Mounter who leads the design systems team at GitHub about how moving to a utility-based approach has made things infinitely more maintainable for them, and given their developers a lot more confidence:
http://www.fullstackradio.com/75
If you have any questions I'll be checking the comments, thanks!
Re: Tailwind: A Utility-First CSS Framework
#16Earlier quoted context omitted.
Yes, the problem is that this library just replaced typing with without realizing that the first is considered a bad practice for a reason and that the second is equivalent.
Isn't that basically the same thing as inline styles? Not quite, for a few reasons: Inline styles don't respect media queries, which basically rules out responsive design Inline styles aren't limited to pre-defined options, meaning you can still end up with 90 different shades of blue) Inline styles cause specificity issues, since they trump separate stylesheets. Inline styles don't support print-specific styles. Inl…
Re: Tailwind: A Utility-First CSS Framework
#17Tailwind is the only CSS framework I use since I discovered it and I'm gradually converting my/company projects to use it.
Re: Tailwind: A Utility-First CSS Framework
#18Re: Tailwind: A Utility-First CSS Framework
#19I personally have an issue with this "Utility/Functional" CSS pattern. To me I still think that the good old "HTML describe how the content is organized, CSS describe how this content looks like" is the way to go. In the end it's how CSS and HTML were designed at first. But when I see that I'm sorry but it just doesn't feels right to me.
Author of Tailwind here! If you have the time, I wrote a big article about this a while ago and would be curious to know what you think: https://adamwathan.me/css-utility-classes-and-separation-of-...