Photo of Nathan Shubert-Harbison Nathan Shubert-Harbison

Main content

LESS, not just compiled client-side

I’ve come across quite a few blog posts and podcasts lately comparing the two popular CSS supersets LESS and Sass. And although these resources are relatively useful, I’ve noticed nearly all of them presenting the same false assumption: that whereas Sass can be compiled server-side, LESS is compiled client-side only. They then come to the conclusion that since you don’t want to rely on JavaScript to compile your CSS, Sass is a better bet. Now, if that assumption were correct, then that would be a respectable conclusion, but the fact of the matter is that LESS is not limited to client-side compilation.

First off, you can compile LESS server-side. Whereas Sass compiles server-side using Rails, LESS does so using Node.js, thus scoring several nerd-core points.

For an even easier way to compile LESS, you can also download the Less app that runs in the background and compiles a .css file whenever a .less file is saved in one of the app’s watched folders. To make a folder watched, you simply drag it into the app. Nothing could be easier. So you end up with a css file that you can use locally and for deployment, written in LESS, compiled as CSS, and you don’t have to worry about Node.

I realize that I’m probably coming across sounding like a complete LESS fan-boy. And don’t get me wrong, I do really love working with LESS. But I just felt behooved as someone that uses LESS and doesn’t compile client-side, to counter this common misconception and remind folks about non client-side methods of compiling LESS code.

Update – 7/4/15: I’ve long since moved from LESS to SCSS when it became evident that SCSS was far more actively maintained and had eclipsed LESS in features and community adoption.