News for hackers. Stuff that matters.
Re:How We Could Write Better CSS by russelluresti on Tuesday September 24, 2013 @02:57PM (#6439953)
While I will not argue that the mixpanel css is pretty bad (specifically the duplication making it harder to maintain and increasing the code size), but that margin example from FB is just as awful.

I know that there's recently been a backlash against the entire idea of the "separation of concerns" - but having your markup define your style margins is a bit insane. If suddenly you wanted 10px margins instead of 5 you have to grep your entire codebase for .m∗s (limiting the length of the string to 3 characters) and updating all those to .m∗m (or just defining both .m∗s and .m∗m to be 10px, which is just as dumb).

But, yes, most of the points in this article are somewhat accurate if not a bit outdated. Try not to use element selectors (and instead apply a class), avoid code duplication, write efficient selectors, etc.

(Note: asterisk changed to low asterisk and I hate markdown or whatever other text styling syntax HN is using).

Re:How We Could Write Better CSS by Jormundir on Tuesday September 24, 2013 @02:58PM (#6439962)
Isn't what you're describing the easy way to change a site?
Re:How We Could Write Better CSS by russelluresti on Tuesday September 24, 2013 @05:18PM (#6440831)
Normally, sites will have more views than they have CSS objects. So if you're doing OOCSS it would be easier to just update all the objects (css files) instead of updating all the views.