News for hackers. Stuff that matters.
Re:Phoenix 1.7.0 Released: Built-In Tailwind, Verified Route... by CSSer on Sunday March 05, 2023 @11:53PM (#35037630)
If I can chime in here, yeah that’s the gist although I’ll say Tailwind isn’t a panacea. My team and I still write vanilla CSS, but it’s less common and much more navigable. It’s usually because the Tailwind version (if the utilities exist) would be unwieldy.

When I started writing CSS I would commonly encounter modestly sized websites of only a couple hundred pages with 17 thousand lines of CSS or more because of frameworks like Bootstrap. At least a few hundred of those lines would be overrides and just as many would probably be redundant.

My team launched a 6 thousand page website this past year with only a couple hundred lines of vanilla CSS and roughly 3 thousand lines of Tailwind generated CSS total.

At the end of the day, Tailwind is a zero-runtime, tree-shakable CSS framework generator. The burden of naming many common and universal design artifacts is alleviated. Class reusability goes through the roof. Custom stylesheets regain the ability to be edited with confidence again. It’s good. It makes the HTML a bit bloated and ugly which deters people at first, but dev tools pick up the slack and so far I’ve yet to see any performance impact there.

Re:Phoenix 1.7.0 Released: Built-In Tailwind, Verified Route... by Scarbutt on Monday March 06, 2023 @01:35AM (#35038121)
How many of those 6k pages use the same CSS?
Re:Phoenix 1.7.0 Released: Built-In Tailwind, Verified Route... by pcthrowaway on Monday March 06, 2023 @04:32AM (#35039120)
Not the person you replied to, but the answer is: all of them

That's just how tailwind works.

Re:Phoenix 1.7.0 Released: Built-In Tailwind, Verified Route... by CSSer on Wednesday March 08, 2023 @11:18AM (#35070867)
pcthrowaway is more or less right. Tailwind dramatically improves code coverage. A majority of tailwind's common utilities are used in every page's components or templates.

There are exceptions. We could use postCSS to code-split critical paths for CSS. It sounds like a fun side project for some framework's ecosystem. Unfortunately, the current state of CSS is very much good enough for me for now. I'm much more concerned about main thread work from JavaScript and optimizing images for the web, for example.