Alex Rivera | Logout

Less Compiler for Linux

Asked 2011-08-30T15:36:38.867
44

Is there a something like less.app that can compile LESS into CSS? I don't care about a GUI and don't want to install it via NPM (node.js package manager.)

Edit
Report

2 Answers

8

in fedora or centos distribution you should

$ sudo yum install rubygems
$ sudo yum install gcc-c++
$ sudo yum install ruby-devel     
$ sudo gem install less
$ sudo gem install therubyracer 

$ lessc yourLessFile.less > yourCssFile.css
answered 2012-08-14T22:47:57.377
2

One solution is a bash script discussed here: https://www.maltheborch.com/2011/09/less-app-on-linux And available as a gist here: https://gist.github.com/malthe/1234308

It requires node, lessc, and inotify-tools (a small library for watching changes to files.) Simply throw it in a file, make that file executable, then run it with a directory as the argument.

The downside is that while it will watch a directory recursively, it will only compile whichever file was modified--it doesn't have the ability to automatically compile the less files which import the one you're working on.

Update: A similar option is this slightly more complex bash script which adds a few features: http://code.krml.fr/less.app

answered 2012-04-28T00:37:43.750

Your Answer