Re:Scalable and Modular Architecture for CSS
by judofyr on Monday September 26, 2011 @06:39AM
(#3038292)
SASS can be dangerous when it comes to nesting. It's so easy to just keep nesting rules, and before you know it you've coupled your CSS tightly to the structure on one specific page.
[ Parent
| on HN ]
Re:Scalable and Modular Architecture for CSS
by bobfunk on Monday September 26, 2011 @08:09AM
(#3038488)
Couldn't agree more. I'm actually starting to become very skeptical of my own use of compass and sass.
SASS makes it extremely easy to generate loads of really complex selectors that are very tightly coupled to the HTML they are styling.
Mixins also makes it very easy to end up with badly bloated CSS. When a mixin defines a gradient and you apply it to different selectors, you'll get the whole bunch of browser prefixed gradient declarations repeated in lots of different places of your final css. A simple class with the gradient defined used in the HTML will make the final CSS much leaner.
Personally I've decided to limit my use of SASS/compass far more and follow a style much closer to what's described in this article.
Re:Scalable and Modular Architecture for CSS
by jwdunne on Monday September 26, 2011 @08:18AM
(#3038521)
Another thing is that, generally, the more nesting you add, the more inefficient the compiled CSS will be. Getting carried away with SASS-like nesting could very well produce a splodge of inefficient, single-use CSS.