5 ms·
It is convenient but you are not separating markup and presentation. I think the whole point of css is to swap stylesheets and get a different presentation, lik
by sanbor 8y ago
It is convenient but you are not separating markup and presentation. I think the whole point of css is to swap stylesheets and get a different presentation, like demostrated by http://www.csszengarden.com/ http://www.csszengarden.com/ BEM/OOCSS lets you do this.
- joecampo 8y agoI highly recommend you read: https://adamwathan.me/css-utility-classes-and-separation-of-concerns/ https://adamwathan.me/css-utility-classes-and-separation-of-...
- aarondf 8y agoI see this argument as similar to the "what if I want to switch my framework later" or "what if I want to change my database later". I think it's a nice idea, but I'm not sure when you would ever redesign everything _without_ touching the HTML.
- ssijak 8y agoHow many times you do that in real project? Or have you ever done that in your career? And if a project needs substantial redesign it is usually acompanied by the functionality change, which means you need defferent html/components too, so you still can`t just swap css files.
- rverrips 8y ago+1 on this for "real projects" that actually do use different styles. Our enterprise e-commerce platform uses an internally maintained design system with utility classes only, very similar to tailwindcss. We have 15 different "brands", so simply reference a different "brand" to get it's unique styling, while the utility classes all remain the same.
- carapace 8y agoI think a lot of folks underestimate just how much can be done with this approach. "Steel" http://www.csszengarden.com/219/ http://www.csszengarden.com/219/
- deleted 8y ago[deleted]
- zumu 8y agoI have done this a few times for large parts of a projects. Much more common, however, is overriding styles at the component level, which gets funky with this approach. You either have to add JavaScript logic to assemble the appropriate class names or you wind up with a situation where elements have classes that conflict with their styles, because they are overridden. Imagine something with .text-purple, where the text is clearly not purple.