43

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.)

Owen Versteeg
  • 342
  • 2
  • 14
Rigel Glen
  • 1,289
  • 3
  • 14
  • 20
  • 16
    Just `#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
  • 24
    I 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
  • 4
    I 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 Answers7

49

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.

Community
  • 1
  • 1
Grzegorz Rożniecki
  • 27,415
  • 11
  • 90
  • 112
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
8

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

Natim
  • 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
  • 3
    The 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
3

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.

https://github.com/luislobo/Lobo-LessCSS-Compiler

Luis Lobo Borobia
  • 994
  • 11
  • 25
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

Johann
  • 4,107
  • 3
  • 40
  • 39
1

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/

0

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.

Alex Objelean
  • 3,893
  • 2
  • 27
  • 36