3 ms·
This is why, as someone who loves writing CSS and thinks they're reasonably good at it, I've come to the conclusion that writing CSS is an anti pattern, and if
by madeofpalk 5y ago
This is why, as someone who loves writing CSS and thinks they're reasonably good at it, I've come to the conclusion that writing CSS is an anti pattern, and if you want teams to quickly build interfaces with a maintainable "frontend styling layer", it should prevent the ability to write css.
- felipemnoa 5y agoWhat would you recommend instead of CSS?
- bamboozled 5y agoTailwind
- eurasiantiger 5y ago… which is a CSS utility class library and thus suffers from some of the same pitfalls. How about something like Ant Design?
- svachalek 5y agoUnless something major has happened to it since I used it, Ant uses a giant ball of SCSS with complex selectors that make it ridiculously hard to customize without hacking the source.
- eurasiantiger 5y agoHacking is exactly what we are trying to avoid. Just change the variables to suit your branding and compile the SCSS yourself, just like Bootstrap (which was using LESS but otherwise the same idea).
- bamboozled 5y agoNever been an issue for me. I hear this a lot though, it's probably not for everyone.
- madeofpalk 5y ago> complex selectors that make it ridiculously hard to customize without hacking the source. This, to me, is a feature. Don’t customise it.
- xeromal 5y agotables
- madeofpalk 5y agoIt must be CSS in the end, but you should create/use a component library, that has the right set of primitives (and less-primitives) that lets end feature developers create the UIs without having to resort to manually write CSS. THis is made significantly easier when you have designers working with this "design library" mindset also.
- alwillis 5y agoI've come to the conclusion that writing CSS is an anti pattern I don't think this is true. The biggest problem is people who write CSS do it as if they want CSS to be something else and are trying to force it to be that. Writing CSS using ITCSS (Inverted Triangle CSS) [1] solves so many of the issues devs complain about it. It's simple: create layers in specificity order. Don't fight the cascade; make it work for you. Writing good CSS isn't about getting the syntax right; it's about getting the architecture right [2]. Harry Robert's video does a great job of describing all the pain points ITCSS solves [3]. [1]: https://dev.to/carlillo/understanding-itcss-real-case-using-itcss-in-a-ghostcms-blog-1p9b https://dev.to/carlillo/understanding-itcss-real-case-using-... [2]: https://www.xfive.co/blog/itcss-scalable-maintainable-css-architecture/ https://www.xfive.co/blog/itcss-scalable-maintainable-css-ar... [3]: https://www.youtube.com/watch?v=1OKZOV-iLj4 https://www.youtube.com/watch?v=1OKZOV-iLj4
- madeofpalk 5y agoI think the problem is that just not that many people know how to write good css and good JavaScript. So I try and just require them to only know JS. I think it’s hard to hire lots (…hundreds) of developers who’s going to know CSS well enough to not screw it up.