

Ask HN: Sass and Less - practical problems. How do you cope with these? - josefrichter

Using Less and Sass (Scss) for a while, there are two practical problems, which I dislike and am interested if you have the same problem and how you cope with it.<p>Imagine this piece of less/sass:<p>section one at http://pastie.org/3138269<p>Problem 1) if you have lots of properties, you don't see all the code on single screen and you see for example just this:<p>section two at http://pastie.org/3138269<p>The problem is you don't have any indication that .baz inherits from .foo and .bar, plus you get into parenthesis hell at the bottom.<p>In plain old css you would see<p>section three at http://pastie.org/3138269<p>and everything is clear. The only thing that helps a bit is code collapsing in the editor. Other partial solution might be the editor automatically adding comments to code like this:<p>section four at http://pastie.org/3138269<p>Problem 2) I decide I want to apply .baz style on completely different place. In plain old css I would do<p>section five at http://pastie.org/3138269<p>In less and sass I am in trouble. I have to a) duplicate the code from .baz to #elsewhere, which is poor solution or b) take out .baz definition "out" to the top level, which is also problem, because you won't transfer the inherited properties.<p>Obviously there are many benefits that keep me using less/sass, but I am really curious how do you guys cope with these problems.<p>Thanks.
======
gerggerg
If using the tool is more burdensome than the solution it proposes, don't use
the tool. In other words, less and sass are for developer readability. If your
styles are easier to read without them(in parts or in whole), then write your
styles without them (in parts or in whole).

There's nothing wrong with writing

    
    
        .foo .bar .baz {
          /* some properties */
        }
    

in a less/sass file that also heavily uses less/sass readability features.

