How to compile Less file into CSS file ?

Less (sometimes stylized as LESS) is one of the dynamic style sheet languages that can be compiled into Cascading Style Sheets (CSS), or can run on the server-side and client-side.

How to install Less ?

The easiest way to install Less on the server, is via npm,

Step 1 – Download and Install nodejs from https://nodejs.org/
Step 2 –After completing installation Open your command prompt or Terminal and type the command

[java]
npm install -g less
[/java]

How to run and compile Less ?

On the command prompt, go to the folder which contains the Less files (for example Style.less) and execute the following command.

[java]lessc styles.less > styles.css[/java]

Output : You Found new file “styles.css”

FOUND THIS USEFUL? SHARE IT

Leave a Reply

Your email address will not be published. Required fields are marked *