less Getting started with less Installation or Setup


Example

Less has been one of the most popular CSS Pre-processors, and has also been widely deployed in numerous front-end frameworks like Bootstrap, Foundation, etc. The Less Compiler is a JavaScript based compiler, which can be obtained from a Content Delivery Network:

<script src="//cdnjs.cloudflare.com/ajax/libs/less.js/2.5.1/less.min.js"></script>

You need to add your Less document before the JavaScript compiler is loaded, using <link /> tag. The Less stylesheet along with the compiler looks like this:

<link rel="stylesheet/less" type="text/css" href="main.less" />
<script src="//cdnjs.cloudflare.com/ajax/libs/less.js/2.5.1/less.min.js"></script>

Note: Compiling Less in the client-side (or in the browser) is generally not recommended. It should used only for development or when using dynamic settings that make it not possible to compile server-side.