4 ms·
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 t
by ehutch79 3y ago
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/ https://getbem.com/introduction/ )
- kingofthehill98 3y agoIt'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.
- ehutch79 3y agoThat'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.
- Yiin 3y agoA great read on the topic: https://adamwathan.me/css-utility-classes-and-separation-of-concerns/ https://adamwathan.me/css-utility-classes-and-separation-of-...
- isleyaardvark 3y agoI need to bookmark that link, it's perfect.
- AlchemistCamp 3y agoBEM 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.
- ehutch79 3y agoUtility classes are good and all. Scoped css is great. "Naming things is hard" is still such a cop-out.
- reidjs 3y agoYou 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.
- cqqxo4zV46cp 3y ago“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.
- scotty79 3y agoYou could say the same about style="" attribute and !important Mess is still mess even if you are making it through a framework.
- 0xblinq 3y agoAnd 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.