How use LESS fast for development or test?


The first step to do it is go to the github less project. You find it under address:

https://github.com/less/less.js

Click the Clone or download button

and then Download ZIP button.

Unzipp less project. You will see content like that:

Go to dist catalogue.

The dist folder contains of two less files. The less.js file is larger than second file, because it is rich version LESS with comment and addition information. it is good for developer to read less source code. Second file: less.min.js is smaller file in size, better for use on the website.
In this moment you are ready to next step – create first project using the LESS preprocessor.
We create folder with our website. Insert into it HTML file and preprocessor less (less.min.js file) and your less file with less code(e.g. mystyle.less).

Look at HTML file:

And look at content of mystyle.less file:

Run your HTML file in browser.

You see website with styles defined in less file. You haven’t any css file. This css file is generated in the fly. So every time when user visit our website, the less starts and generates css file. Therefore this method using less isn’t recommended.

Remember that using less.min.js in the browser is great only for development and test, but it’s not good for production.

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.