What is the smarter language that is smarter than CSS?

SASS

LESS

Node vs Ruby

Ruby comes pre-installed on far more machines than Node.js does. Given that these are tools for designers, this makes it harder to install Less than Sass for server side compilation.

Argue against this point

SASS support nested media queries

From the SASS reference:

.sidebar {
width: 300px;
@media screen and (orientation: landscape) {
width: 500px;
}
}

will compile too:

.sidebar {
width: 300px;
}
@media screen and (orientation: landscape) {
.sidebar {
width: 500px;
}
}

Unfortunately, this doesn't work (yet) in LESS.

Argue against this point

Conditions in CSS

Hi Guys,

i really like the simple approach behind less and would like to have conditions like they are possible in scss or sas:

f.e. you ask the user in a cms to setup a color:

And then you need to calculate the textcolor from this color, you will need something like a condition to ensure, that the contrast is still big enough to read the text.

#footer-container {
@if lightness($main-color) < 10% {
color: lighten($main-color,15%);
} @else {
color: darken($main-color,20%);
}

}

Thanks in advance
Kay

https://github.com/leafo/lessphp/issu...

Argue against this point

Mixins produce a more elegant and compact endresult

Less:
.test{...}
.test2{.test}
produces:
.test, test2{...}

Sass:
@mixin test{}
.test2 {@include test}
produces:
.test2 {...}

Besides the fact that the 'mixin' names do not appear in the endresult (kind of namespacing which avoids occasional nameclashing), it also has the advantage that all the not used mixins do not get included in the end result.

Argue against this point

The less watcher not as convenient as you think at first

The Less javascript watcher is very nice, but when development is over you have to edit your templates and change the links to point to the real CSS files instead of the less files unless you want to have a javascript dependency.

If you use a tool like [LiveReload](https://github.com/mockko/livereload) in combination with the sass watcher, there's no markup changes required to have live updates in your webpage.

Argue against this point

Line-tracable debugging support in Firebug

The FireSASS Firebug extension means that with supported compilers (such as LiveReload or the Drupal Sasson theme), you don't have to give up Firebug - an essential tool for most front-end coders.

Without FireSass, Firebug use for any compiled CSS language will only allow you to trace to the compiled css line number, leaving Less without adequate debugging tools. NOTE: A FireLESS extension was developed, but has had poor support, and I've never seen it actually work.

http://nex-3.com/posts/92-firesass-br...

Argue against this point

Global scope

That Sass uses global variables has never bothered me. The advantage IMO, being that it's just as complex as it needs to be in order to get the job done neatly, without complicating things beyond what is necessary. I can't think of a time where I've wanted Sass variables to have more sophisticated scoping.

Argue against this point

Scoping

Less handles scopes as I expect it:

Sass | Less
-------------------------+-----------------
$color: black; | @color: black;
.scoped { | .scoped {
$bg: blue; | @bg: blue;
$color: white; | @color: white;
color: $color; | color: @color;
background-color: $bg; | background-color: @bg;
} | }
.unscoped { | .unscoped {
color: $color; | color: @color;
// Would be an error | // Would be an error
// background: $bg; | // background: @bg;
} | }
And their different output:

Sass Output | Less Output
----------------------------+----------------------------
.scoped { | .scoped {
color: white; | color: white;
background-color: blue; | background-color: blue;
} | }
.unscoped { color: white; } | .unscoped { color: black; }

https://gist.github.com/674726

Argue against this point

ability to use nesting instead of, or in combination with cascading

LESS gives you the ability to use nesting instead of, or in combination with cascading. Lets say we have the following CSS:
#header { color: black; }
#header .navigation {
font-size: 12px;
}
#header .logo {
width: 300px;
}
#header .logo:hover {
text-decoration: none;
}

In LESS, we can also write it this way:
#header {
color: black;

.navigation {
font-size: 12px;
}
.logo {
width: 300px;
&:hover { text-decoration: none }
}
}
Or this way:
#header { color: black;
.navigation { font-size: 12px }
.logo { width: 300px;
&:hover { text-decoration: none }
}
}
The resulting code is more concise, and mimics the structure of your DOM tree.

http://lesscss.org/

Argue against this point

Learning Curve

LESS has a smaller learning curve for designers and developers because the familiar CSS syntax feels very natural. There is almost nothing to learn. SASS's python-like syntax is terse and strange to someone who already knows CSS.

Argue against this point

Platform Support

The original 'lessc' is a Ruby gem. It still works, and LESS can run from Ruby, converting files and watching for changes.

The current LESS compiler runs in Javascript. This means it can run in nearly any browser on the internet (seriously, who turns Javascript off, or runs IE5?). The Javascript base also lets it run anywhere Javascript can run, which includes Adobe Air applications, and on the JVM with Rhino, which in turn means it can be called from any JVM language like Java, Scala, ColdFusion, Clojure, Groovy, and so on.

The Javascript core also supports NodeJS, which has been very quickly gaining support throughout the web development world.

Furthermore, there are unofficial, and very good, ports to other platforms.

The LESSPHP project (http://leafo.net/lessphp/) is on version 2.0, and still under continuous development. This PHP version serves LESS files from the web server, and has a command-line converter and file watcher much like the Ruby version.

The DOTLESSCSS project (http://www.dotlesscss.org/) brings a LESS compiler to the .NET world, which can intercept and compile less files through an IIS file handler, or programmatically in an ASP.NET application, or from the command line, again, like the Ruby version. This project is still under active development and has created some buzz in the .NET world. DOTLESSCSS means LESS can run with any CLI language as well, so it integrates with C#, VB.NET, C++, F#, Iron Python/Ruby/Lisp, and more.

Argue against this point

Node as easily installed as Ruby.

Making the argument that Ruby is installed on more systems is an argument from authority. The same argument could have been made 5 years ago against Ruby v. PHP, and look where we are today. I'd make the counter-argument that configuring Ruby with gems can be just as difficult with versioning as installing Node. Not a valid argument for SASS.

Argue against this point

Ecosystem

LESS has a large (possibly larger), active ecosystem. Consider the ports to PHP (LESSPHP) and .NET (www.dotlesscss.org), and the fact that LESS runs in Ruby, Javascript, NodeJS, and anything that can compile Javascript including Java. The exact size of the ecosystems are impossible to judge.

Argue against this point

Is an argument missing?

Please contribute - sign in and add the argument yourself.

Is an argument inaccurate, incorrect or has it been debunked?

Please contribute a counter-argument that gives a reasonable response to the argument with a web address to a reference for further reading.

Does the text of an argument misrepresent it in a biased or inaccurate way?

Please tweet @stef on Twitter to start a conversation about how to fix it.

Embed this debate

Mash this debate

Get this debate as JSON(P)