I’m convinced 40%+ of the anti-CSS complaining is out of frustration from folks who haven’t actually learned how Specificity works. I wrote CSS for five years before I knew this is a thing I needed to learn. It was @mholzschlag who taught me, at a presentation she gave in NYC.
Always frustrated because your CSS styles aren't working the way you intended? You should learn more about CSS Specificity! Check out my newest blog post 🙃 dev.to/emmawedekind/css-spec…
16
51
9
314
100% agree. I've found a big part of it is that many developers' first experience with CSS is often with frameworks like Bootstrap that have some really terrible anti-patterns in their codebases. Highly specific selectors, overriding its own values etc.
4
2
28
It's no wonder they write bad CSS & end up hating it. I think until you start diving into CSS more and discover methodologies like BEM–and its preaching of flat selectors–that writing CSS becomes much less of a headache. How we get everyone to learn that? Well that's the question
1
6
I don't think everyone should always use 'flat selectors'. Methodologies like OOCSS (the original) can be the right solution for big projects with dozens or hundreds of developers over years, but other projects are better served by other structures. It depends™.
3
1
1
11
Very true. BEM itself isn't necessarily the right methodology, but it's a good example for people see it in action. But then again, as you said, there are much easier ways to approach it. It would be great to have a list of these articles to share with people when they complain.
1
1
The biggest issue I’ve encountered with these various methodologies is that those starting out getting their head around CSS are looking for guidance on what is ‘the right way’ to do CSS. Depending on where they land, they get different answers to that question.
2
1
4
Yes, and it changes frequently Ben, adding to the confusion. This is why we need better design thinking and common pathways along with a lot of #open discussion. Iterative processes, understanding the right tool for a given job and so on. Hope you're having a happy 2019 so far!
1
5
Also, there is no one right way. That's definitely problematic for everyone. The best way to handle that IMO is to remember Occam's Razor. One person who is utterly brilliant at figuring out "best ways" is @meyerweb - he troubleshot a CSS problem at AOL. I don't think that way.

Jan 23, 2019 · 5:11 AM UTC

3