Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Less Compiler for Linux [closed]

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

like image 975
Rigel Glen Avatar asked Aug 30 '11 15:08

Rigel Glen


People also ask

Does less need to be compiled?

Using Less. js in the browser is the easiest way to get started and convenient for developing with Less, but in production, when performance and reliability is important, we recommend pre-compiling using Node.

How do I install Lessc?

Installation of LESSDowload the Latest Features version of the zip file. Step 2 − Run the setup to install the Node. js on your system. Step 3 − Next, Install LESS on the server via NPM (Node Package Manager).

How do I create a less CSS file?

Pre-compiling LESS into CSS: To compile LESS into CSS, we use the below command in a command prompt. The lessc command lets us precompile our LESS file into a basic CSS file. This helps us in writing modular code using LESS programming and still getting all the benefits of CSS by compiling it into traditional fast CSS.


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

like image 93
Xaerxess Avatar answered Sep 22 '22 13:09

Xaerxess