Is all of the finger pointing necessary?
Maybe not, I just want to illustrate the point that so many big names are writing poor CSS. My main motivation is constructive though.
I don't care about the finger-pointing (I find it kind of funny anyway) but the message is appreciated. I waste SO MUCH of my time trying to figure out the best way to do things. I've tried the so-called "semantic" approach of using as little classes as possible in my markup and leveraging SASS mixins/extend to do all the heavy lifting and it just becomes a clusterfuck of selectors. Recently, I've adopted the OOCSS/BEM approach and it's working really well but seems to offload a lot of presentational logic into your views — which isn't ideal either.
The idea that we all come together and standardise around one way of working (based on some actual metrics) would be awesome.
So you're proposing that we should write unsemantic CSS?
Having to use 10 css classes to style up an element kind of defeats the purpose of CSS doesn't it?
More examples of what I'm talking about: http://css-tricks.com/semantic-class-names/
I just used a class based approach in my example for those who aren't familiar with preprocessors yet.
I'm proposing that we all come together to figure out the most optimal way to apply CSS to each element, then all follow the same approach.
The article was not about nitpicking on what's right or wrong. It was about outlining how different our approaches are and how we might benefit if we all used one approach.
Obviously it went straight over most people's heads.
I agree that it would be useful if we had one approach. Although, the only benefit to structuring HTML/CSS a certain way is for readability and maintainability. Whatever works for your team is cool.
That being said, spending most of the article pointing fingers and nitpicking is probably why we thought the point of the article was to point fingers and nitpick.
Mixpanel's CSS could be complied SASS. In app development, sometimes the conciseness of the complied CSS is sacrificed for SASS that is simpler to write and maintain.
Seems like they could just replace their @include' by @extend's in that case?
Yeah definitely (assuming of course they're using SASS and just not writing duplicative code). But the ultimately it doesn't matter THAT much. Using mixins or extends simplifies maintainability in the same way that CSS originally aimed to making styling simple by introducing rulesets. What are mixins and extends other than rulesets that are applied to rulesets.
It is nice to save the bytes by not having to send duplicative CSS over the wire, for sure.