Is there any reason to prefer one over the other?

Thanks

Comments

corey.aufang’s picture

In the end it comes down to personal choice, but let me make a short comparison for you.

SASS uses an entirely new syntax that with indentation based nesting, and no end of line delimeters. To use SASS you have to completely rewrite your CSS.
(pulled directly from http://sass-lang.com/)

// Sass

table.hl
  margin: 2em 0
  td.ln
    text-align: right

Some of the things that SASS extols as virtues I think are exactly the things wrong with it.
Removing brackets and basing nesting on how far a line is indented I think is a step backward in design.

LESS takes standard CSS syntax and extends it:

//LESS

table.hl {
  margin: 2em 0;
  td.ln {
    text-align: right;
  }
}

Both of these samples create this same CSS:

table.hl {
  margin: 2em 0;
}
table.hl td.ln {
  text-align: right;
}

Because LESS is based on standard CSS syntax you can paste in large amounts of plain CSS and LESS will make no alterations.

Since LESS syntax is similar to CSS, it is also easier for someone with CSS experience to learn LESS.

ManyNancy’s picture

Thanks, answers the question well. :)

corey.aufang’s picture

Status: Active » Fixed

marking as fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

cabbiepete’s picture

Just wanted to update this for anyone else finding it via Google. Sass now supports a superset of CSS syntax, file endings are .scss by convention. Or alternatively the indentation style (HAML) file endings still .sass by convention.

guysaban’s picture

You may also want to see this about SASS: http://nex-3.com/posts/83-sass-and-less
It has some advantages over LESS.

And this from ZivTech (a Drupal webshop): http://www.zivtech.com/blog/css-suckers-introduction-sass-compass

bcreeves’s picture

SASS uses standard CSS syntax as of version 3.0

http://sass-lang.com/docs/yardoc/file.SASS_CHANGELOG.html#3-0-0

lsdkfjmdkl’s picture

@corey.aufang, sass also has the scss syntax, which is a superset of CSS. (It means that you don't need to rewrite you whole CSS file, it just works with SCSS.)

See http://sass-lang.com/

Like LESS, SCSS takes the CSS syntax and extends it.

BTW the sass-convert tool that comes with sass knows how to convert from and to the sass, scss and css formats.

Any other pros/cons ? (I found this page while searching for "less vs sass" ;-) )