Installation of LESS

Installation Of Less in your Computer
Install the Less in your Computer using the command line. Before that you must install the Node.js in your system. Go to nodejs.org and download the node js setup file. And install into your computer its like the normal installation next and finish.
After that, open the command prompt in your computer. Type the following command in the command line to install the less in your computer.

npm install -g less

Type above command and press enter less will install in your computer.

After installation, you can compile the less file and get the output in your computer.


How to get the compile code in command line itself.
You can compile less file in command line and get the output also in command line by using this command. First, navigate to the folder in the command line and now type this command.

lessc styles.less
Styles.less is a less file name you have any other file name change the styles.less for what you have.

Now the output will generate in command line itself.

How to compile and get the output in a separate file.
Run the below command to get the compiled output in the separate css file.

lessc style.less style.css

Now the output will be generated in the separate file css file.



How to compile in the browser itself.
This process to compile your less code in the browser on client side. This will compile the css code in the browser at the time of web page load.

For this operation you must include the LESS.js file in the web page for compile process. You must download the LESS.js from the https://lesscss.org and include in the head section of the webpage.
Like this
<link rel="stylesheet/less" type="text/css" href="css/style.less" />
<script src="js/less.js" type="text/javascript"></script>
Copyright Labw3