News for hackers. Stuff that matters.
Re:CSS: Taking control of the cascade by config_yml on Monday September 12, 2011 @01:54PM (#2988202)
I've worked on a project which used a technique like this, but was not even as closely mirroring the DOM, and the end result was terrible. We ended up with specificity horrors which will best not be seen. Nobody wants to touch those stylesheets anymore.
Re:CSS: Taking control of the cascade by kuroir on Monday September 12, 2011 @09:50PM (#2989629)
I wrote a little post response to the OP article showing the problems and what you should do to avoid them.

[CSS: Don’t take control of the Cascade, make love to it.](http://kuroir.com/post/10148994785/css-dont-take-control-of-...)

Hope you find it interesting.

Re:CSS: Taking control of the cascade by kylemathews on Monday September 12, 2011 @02:34PM (#2988347)
Some details would be nice.
Re:CSS: Taking control of the cascade by config_yml on Monday September 12, 2011 @03:20PM (#2988535)
Well, multiple editors were at work. The approach described creates selectors that were generally more specific than they needed to be. Eventually, people needed something to be styled differently in a context that was already heavily specified. So they needed to have even more specific selectors to override an existing selector. As soon as someone stuck some ID in front of that whole selector (which is almost too easy using SASS/SCSS) it was basically game over.

I think OOCSS is an approach to help here, but once you have such a mess it is pretty hard to refactor.

Re:CSS: Taking control of the cascade by rimantas on Monday September 12, 2011 @03:26PM (#2988557)
God, when this OOCSS thing will be forgoten. It just moves mess to another place and instead of mess in CSS you get mess in CSS and HTML.
Re:CSS: Taking control of the cascade by config_yml on Monday September 12, 2011 @03:46PM (#2988622)
I guess you can create a mess either way. For me OOCSS was easy to scale out onto lots of elements and it was certainly easier to keep track of what is affecting what once you change something.
Re:CSS: Taking control of the cascade by joevandyk on Monday September 12, 2011 @02:01PM (#2988237)
did you use child selectors? did you use @extend?