To use Less for web developing we need to install node.js package manager on our server after that we have to compile the .less file to the css file through the command-line. But with the help of Client-Side we do not have to compile .less file to css file again and again. We can compile the less code to the actual css code withe help of less.js file. We just need to download the less.js from https://github.com/less/less.js/archive/master.zip or we use the CDN for less.js <script src=“//cdnjs.cloudflare.com/ajax/libs/less.js/2.7.1/less.min.js”></script>. we just need to link the less file just above the less.js included position and after every refresh less.js compile the less code to the actual css code.
This Client-Side usages is only for the development not for the production as in every page refresh less.js calls a ajax request to compile the less code so it may slow your production site. So you can pre compile the less code with the online less compiler i.e http://less2css.org/
Be the first to comment.