News for hackers. Stuff that matters.
Re:TailwindCSS v2.0 by cactus2093 on Wednesday November 18, 2020 @07:37PM (#25144764)
Lots of good responses already on other ways to abstract, but I'll even go one further and say "sure, why not?"

When are you changing every single instance of "lg:text-7xl"? More often you're probably making a change in one single place in the app, in which case this is incredibly easy, you just make your change where you want. You're not slowed down by digging through layers of abstraction cruft and indirection until you find the right place to make the change.

If you're doing an entire site design refresh, then doing some find and replace isn't really that crazy. For something you do relatively infrequently like this (maybe every couple of months or even every couple of years?) it's not a big deal if it takes a little bit longer. And likely you'll need to look through and test your changes on every page one by one anyway, to make sure you're not breaking anything you didn't mean to. You'll need to do that whether you changed the definition of a css class, or you made a bunch of inline changes, at which point making the actual code edits inline probably isn't even the bottleneck.

But again, that's perhaps a bit extreme of a way to look at it. You will inevitably have some layer of abstraction anyway, something like components or templates or partials, in which to wrap your styles.

Re:TailwindCSS v2.0 by JxLS-cpgbe0 on Wednesday November 18, 2020 @08:07PM (#25145017)
> When are you changing every single instance of "lg:text-7xl"

I'm not, I'm changing some 7xl-sized text in multiple places. But I don't want to change every element that is .lg:text-7xl already.

> If you're doing an entire site design refresh

I'm not

> You will inevitably have some layer of abstraction anyway, something like components

I already do, they're in JS, and much more powerful and extensible than HTML attributes.

Re:TailwindCSS v2.0 by kbatdorf on Wednesday November 18, 2020 @11:30PM (#25146237)
You could also update the Tailwind config file to define what "text-7xl" is. Default is "4.5rem"
Re:TailwindCSS v2.0 by hanniabu on Thursday November 19, 2020 @02:06AM (#25146970)
> But I don't want to change every element that is .lg:text-7xl already.