I'm πŸ’―% convinced it's mass hysteria. Some chumps decided CSS was "too hard," told everybody they know, and it just became the prevailing sentiment.

Like... if you can reverse a binary tree but can't learn 3 CSS properties to centre a div? The problem is not with CSS, homie. πŸ€·πŸ»β€β™‚οΈ
---
RT @gwtrev
@TrezyCodes i still don't understand why it's so hard for folks to just write CSS. it's really simple.
https://twitter.com/gwtrev/status/1593288248771723265

inasuma Χβ€Žβ‚€ on Twitter

β€œ@TrezyCodes i still don't understand why it's so hard for folks to just write CSS. it's really simple.”

Twitter

@TrezyCodes there is merit to the abstraction, you can gain some systemic consistency with spacing, colors etc, you know the size of your CSS because it never grows beyond the utility classes, and if a whole team learns it, there can be some DX gains.

That said, I’ve never cared to learn it because I don’t care to learn a DSL for something I already know very well.

It’s also why I never weigh in. TW is fine, I just don’t care.

@TrezyCodes like I just built a design system where the props and types enforce the style system (kinda like Chakra). It’s really the same thing in a way, but frankly less soupy than strings on strings on strings IMO.

@kyleshevlin Yeah, I totally get what you're saying, but you can achieve the same with CSS/SCSS and some simple linting rules without needing to write the esoteric string soup of Buttswind.

I think the thing that bugs me the most is that the tradeoffs outweigh the benefits by, like, a lot.

@TrezyCodes You actually can't though. With TW, the big benefit is that your styles cannot, by definition, grow. You have all the classes your app will ever have, it's a known cost.

CSS/SCSS frequently is an add-only file, you never know what's safe to remove (without scoping), so it _only_ grows.

To be clear, I am not in the TW cult. Just willing to admit that I get that benefit.

@kyleshevlin Aaaaah, I follow. You actually can (and often do) create arbitrary classes with Tailwind, tho. I'm thinking of things like text-[#1a1a1a], or custom gradient backgrounds.

I think the difference is that Tailwind creates more friction in that process, whereas it's the default in CSS.

@TrezyCodes Agreed, making extra classes is a pain.

My hunch is it would be better if the abstraction was something other than string soup so it would be easier to parse & type, but I don't care enough about the problem to figure it out.

I'm happy to write CSS, and as a React dev, object notation is good enough for me.

@kyleshevlin I think you're right. My big issue with the absence of maintainability. If there was a better way to write it I'd be way more onboard.

@TrezyCodes I actually had this crazy idea the other day to make a similar system with composable functions.

I wanted to make something that demonstrated that building up classes is really the same thing as function composition in FP.

@kyleshevlin I love that idea! ❀️