Why sass (scss) is better than less
Short story
SASS
- has watch mode
- nested properties
- easier to debug
- !default flag for variables
- @extend for inheritance and placeholder selectors
- @if, @for, @each, @while directives
- function directives - nuff said
- supports keyword arguments
- http://compass-style.org/
- extensions
- apps
- foundation is built on sass - http://foundation.zurb.com/
less
- twitter bootstrap is built on top of less (but there are ports of it for sass)
- easier to get started with
- ugly error messages
- while some (most) of control directives can be achieved through guarded mixins, they look counter intuitive and require repetition and hacks
Long story:
Written by Victor Zamfir
Related protips
9 Responses
Another great point for SASS: named arguments for functions/mixins
@dpashkevich Indeed, that is a very cool feature
@duiker101 Yes, but it doesn't have control directives, loops and so on. As others stated, you can do that (if-s with guarded mixins, loops with recursive calls etc), but they are not as intuitive as they are in sass (and they are harder to maintain and write).
Also, less lacks things like sass' @extend (yes, you can include other mixins or classes, but it will generate more code) and many others.
I do like less too - I've been using it for a year now :), the main reason being that twitter bootstrap was written in less. But I like more the expressiveness and power of sass. It's also more actively maintained.
Btw, the extend
functionality for LESS is in the works... Just a side note. Add Sass like extend
@dpashkevich great to hear that
Sass requires Ruby, which can make maintenance of app more complicated if app itself isn't written in Ruby (maybe it works in JRuby, though). Less has more implementations, and main implementation in javascript works in many environments (browser, node.js, JVM - rhino).
Please, don't add CodeKit as Sass Pro argument - CodeKit supports Less too.
@kolen - your application doesn't have to be written in ruby, not at all, but sass requires ruby.
@dcsturm - last time I checked CodeKit was able to handle sass only. Now I see it can compile less too.
But I don't use CodeKit anymore. If you want something at least as complete as CodeKit, have a look at http://yeoman.io/
Can someone explain to me (or link to a blog post), WTF is wrong with CSS in the first place?