Thoughts on LESS or SASS

Out of context: Reply #11

  • Started
  • Last post
  • 17 Responses
  • Stugoo0

    For a long long time I was adverse to pre-processors, simply because I think that it breeds bad habits. With that being said, now, whenever I go back to an old project I set aside a couple of hours to rework the stylesheet into SASS.

    My first experience with it was a terrible set of over-nested declarations with overused mix-ins and confusing variables, unthoughtful class structures etc. However at the start of the year I used stylus for the first time in a project, and now I use SASS because as a freelancer it tends to be the pre-processor of choice for any agency I work for and now I really see the benefits:

    1. it's good for modular development you can split out files into modular blocks and worry about having to concatenate and minify later. The files become production ready quicker.
    2. It makes maintaining colours, fonts, and media-queries much much easier.
    3. It makes maintianing breakpoints in CSS easier
    4. Writing vendor prefixed code becomes easier

    However I have found that pre-processors can really breed bad habits. I have also spent a long time understanding how to write clean, efficient and object orientated CSS and making sure that this translated into my stylesheets from SASS took a little bit of time.

    Furthermore I tend not to use mixins and functions, with the exception of vendor prefixing. I only nest one or two levels and keep declarations clean and concise.

    Despite what I am saying above and listen to people re-regurgitate the 'omg it's CSS like it was intended' I do not want to depend on it. I feel the same way about jQuery, and have subsequently learned (learning) JavaScript.

    What makes CSS and HTML so good is that you really need nothing to get started pre-processors may increase your workflow but goddammit, make sure the output is efficient.

View thread