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.)
-
16Just `#apt-get install node-less`, then `$lessc styles.less`. – Ivan Kharlamov Apr 25 '12 at 12:05
-
less.app monitors files and recompiles them automatically. If you looking for automatic compilation on Linux, here is how to do it: http://stackoverflow.com/questions/13671969/how-to-automatically-compile-less-into-css-on-the-server/13671970#13671970 – romaninsh Jan 18 '13 at 18:19
-
24I wonder why on earth this question was closed as "not constructive"? It's a perfectly ordinary technical question, and doesn't seem to me "likely" to "solicit debate, arguments, polling, or extended discussion" -- nor has it. – Teemu Leisti Mar 08 '13 at 09:48
-
4I agree with @Teemu Leisti. I can't for the life of me figure out why this was closed. – monotasker Aug 19 '13 at 17:11
-
[Autoless](https://github.com/jgonera/autoless) works well for me. No GUI, works with @import and compiles in half a second. However it *is* installed via npm. – Alexander Rechsteiner Mar 14 '14 at 17:44
-
For OSX, see [Lesscss command line compiler Lessc](http://stackoverflow.com/questions/18928028/lesscss-command-line-compiler-lessc). – kenorb Jun 10 '14 at 16:09
-
For OSX, try also: `brew install npm && sudo npm install -g less`. Then it should be installed in `/usr/local/lib/node_modules/less/bin/lessc`. – kenorb Jun 10 '14 at 16:14
7 Answers
Although using node.js
version is recommended, you can install less as ruby gem:
sudo apt-get install rubygems1.8 ruby1.8-dev
sudo gem install rubygems-update
sudo gem update rubygems
sudo gem install less
and than use lessc
which is in /var/lib/gems/1.8/bin/lessc
, so you may want to create symlink:
sudo ln -s /var/lib/gems/1.8/bin/lessc /usr/bin/
or add ruby gems dir to PATH
variable:
export PATH=/var/lib/gems/1.8/bin:$PATH
EDIT:
Using lessc
as described here:
Command-line usage
Less comes with a binary, which lets you invoke the compiler from the command-line, as such:
$ lessc styles.less
This will output the compiled CSS to stdout, you may then redirect it to a file of your choice:
$ lessc styles.less > styles.css
To output minified CSS, simply pass the
-x
option.

- 1
- 1

- 27,415
- 11
- 90
- 112
-
Thanks, it worked fine, but all it does is display it in the terminal, how to make it output to a file ? – Rigel Glen Sep 01 '11 at 04:35
-
1I've edited my answer, but it's basically unix-like output redirect to file (`lessc styles.less > styles.css`). – Grzegorz Rożniecki Sep 01 '11 at 07:20
-
1
-
You know like watch a file for changes and automagically update the .css file – Rigel Glen Sep 04 '11 at 08:27
-
You could set up a [DVC](http://en.wikipedia.org/wiki/Distributed_revision_control) repository (I recommend Bazaar, it's quite easy) and create custom `pre_commit` hook as described [here for Bazaar](http://doc.bazaar.canonical.com/bzr.dev/en/user-guide/hooks.html). – Grzegorz Rożniecki Sep 06 '11 at 14:52
-
-
1This answer does not work. It results in `gem_original_require': no such file to load -- v8 (LoadError)`. In order to fix it, add one more essential ruby gem with the following command: `sudo gem install therubyracer"` – Artur Bodera May 07 '12 at 12:44
-
1+1, although the path to my lessc gem was slightly different on ubuntu 12.04 (`/var/lib/gems/1.8/gems/less-2.2.2/bin/lessc`) – JamesHalsall Sep 28 '12 at 13:46
-
-
-
@Xaerxess I justs did that here, can u please help. http://askubuntu.com/questions/349855/less-css-compiler-help-in-terminal – STEEL Sep 25 '13 at 11:04
-
@Xaerxess here http://stackoverflow.com/questions/19003328/less-css-compiler-help-in-terminal – STEEL Sep 25 '13 at 11:11
-
1If you're asked to install gem 'therubyracer' to use Less, try: `sudo gem install therubyracer`. – kenorb Jun 10 '14 at 15:58
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

- 81
- 1
- 2
You can also use this : http://wearekiss.com/simpless with a beautiful GUI and the watching process to automatically update the file when editing.

- 17,274
- 23
- 92
- 150
-
FWIW, this seems to be broken on ubuntu 11.10 x64 using simpleLESS 1.3 – Tim Howland Jan 22 '12 at 19:33
-
3The thing is that SimpleLess is created using a Crossplatform development tool. And It has huge bugs in Linux. And now, it is being "moved to the community", so, until a community takes the project, and works on it for the linux version, I see no future on bugfixing – Luis Lobo Borobia Mar 08 '12 at 14:12
-
I think these Bugs are caused by the used Framework - Titanium - not by SimpLESS itself. I can't run any Titanium Apps on 11.10. I guess we have to wait until Titanium finally fixes it. – js-coder Mar 09 '12 at 18:33
-
@LuisLoboBorobia are these bugs are fixed? Can't install SimpleLess on Ubuntu, is it a bug or I make something wrong? Simply donqloading, extracting the files nothing seems like install .sh or like that. thanks – YogiZoli Apr 21 '12 at 13:55
I have created a wxPython GUI app that uses node.js less compiler. It is on very early stage right now. Everyone's invited to contribute. I'm planning to make it very similar to MacOS's LessCSS App.

- 994
- 11
- 25
-
Right now, it compiles less files on the same folder. Now I'm coding a destination path configuration / selector – Luis Lobo Borobia Mar 17 '12 at 01:56
-
-
I didn't have the time to continue, and found a "simpler" solution: I created compile.sh scripts, then scheduled them using incron, may be this can be helpful for you in the meantime – Luis Lobo Borobia Mar 26 '13 at 19:39
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

- 4,107
- 3
- 40
- 39
I know, that this answer is quite "too late", but I recently tried to build a simple gui for linux. With JAVA and the less.js it is not just linux, but cross-platform. Simpless isn't supported anymore (since 1.3 as written in their blog) and Crunch uses Adobe Air which is also out of date.
here is my project: http://project.splashfish.de/Le-css/

- 11
- 1
For java there is an open source tool called wro4j.
It uses rhino as underlying engine for compiling less to css, but can also use node.js if it is supported on your environment.

- 3,893
- 2
- 27
- 36