News for hackers. Stuff that matters.
Re:Tailwind CSS v4.0.0 Alpha by ehutch79 on Wednesday March 06, 2024 @12:57PM (#39618732)
Coming up with css class names is not hard. And if you're that creatively inhibited to not come up with the class name 'pricing-card' for cards in the pricing table, there's crutches like BEM ( https://getbem.com/introduction/ )
Re:Tailwind CSS v4.0.0 Alpha by AlchemistCamp on Wednesday March 06, 2024 @01:04PM (#39618824)
BEM was great, for the early to mid 2010s. Utility classes have still been a big productivity win for me.

Working on an app with a great deal of technical debt last year, moving to Tailwind made a world of difference in being able to restyle components without also breaking styles on distant parts of the app that nobody on the team realized were relying on the same styles.

Re:Tailwind CSS v4.0.0 Alpha by ehutch79 on Wednesday March 06, 2024 @02:09PM (#39619887)
Utility classes are good and all. Scoped css is great.

"Naming things is hard" is still such a cop-out.

Re:Tailwind CSS v4.0.0 Alpha by reidjs on Wednesday March 06, 2024 @02:46PM (#39620406)
You can still name things when it makes sense, I just like that in tailwind I don't have to name ALL of the things. It's nice to be able to easily add some margin, or padding, or a few style properties to an element, instead of coming up with a name AND adding those properties in a separate file.
Re:Tailwind CSS v4.0.0 Alpha by cqqxo4zV46cp on Wednesday March 06, 2024 @06:37PM (#39623218)
“Naming things” being one of the two / three hard problems in software development is literally a meme. They didn’t pull it out of thin air.
Re:Tailwind CSS v4.0.0 Alpha by scotty79 on Wednesday March 06, 2024 @10:23PM (#39624738)
You could say the same about style="" attribute and !important

Mess is still mess even if you are making it through a framework.

Re:Tailwind CSS v4.0.0 Alpha by kingofthehill98 on Wednesday March 06, 2024 @01:00PM (#39618777)
It's not exactly easy either.

In the end I'll be writing <PricingCard :price="product.price" /> anyway. All that Tailwind garbage will be nicely hidden inside the component.

Re:Tailwind CSS v4.0.0 Alpha by ehutch79 on Wednesday March 06, 2024 @02:07PM (#39619870)
That's fine. Saying it's redundant is 100% valid. That's not what the OP said.

Saying it's because naming a class is hard is BS.

Re:Tailwind CSS v4.0.0 Alpha by Yiin on Wednesday March 06, 2024 @02:25PM (#39620117)
Re:Tailwind CSS v4.0.0 Alpha by isleyaardvark on Wednesday March 06, 2024 @07:25PM (#39623597)
I need to bookmark that link, it's perfect.
Re:Tailwind CSS v4.0.0 Alpha by 0xblinq on Friday March 08, 2024 @01:26AM (#39638355)
And in practical real life terms (where teams and long term projects and people coming and leaving the team over years and different skill levels, etc) is how CSS becomes a write-only mess.

Tailwind is primarily a way to do "css-in-js", except it's "css-in-html". It might not look nice on the eye but it's fucking easier to maintain, safer to remove, etc. As long as you have a way to create "components" you're fine.

> Coming up with css class names is not hard.

Yes, unless you work alone on your tiny 2 weeks old side project, it's fucking hard.