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

7
  • 16
    Just #apt-get install node-less, then $lessc styles.less. Commented Apr 25, 2012 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: stackoverflow.com/questions/13671969/… Commented Jan 18, 2013 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. Commented Mar 8, 2013 at 9:48
  • 4
    I agree with @Teemu Leisti. I can't for the life of me figure out why this was closed. Commented Aug 19, 2013 at 17:11
  • Autoless works well for me. No GUI, works with @import and compiles in half a second. However it is installed via npm. Commented Mar 14, 2014 at 17:44

7 Answers 7

50

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.

Sign up to request clarification or add additional context in comments.

13 Comments

I've edited my answer, but it's basically unix-like output redirect to file (lessc styles.less > styles.css).
Is there a way to watch files
This 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"
+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)
If you're asked to install gem 'therubyracer' to use Less, try: sudo gem install therubyracer.
|
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.

4 Comments

FWIW, this seems to be broken on ubuntu 11.10 x64 using simpleLESS 1.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
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.
@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
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

Comments

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

3 Comments

Right now, it compiles less files on the same folder. Now I'm coding a destination path configuration / selector
It would be great if you continue this project.
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
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

1 Comment

The links you've provided are dead :(
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/

Comments

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.