Using LESS client-side

You need to download and add to your project less.js and call it from the HTML page:



Then, add the call to the .less file/s making sure you set the rel=”stylesheet/less”:



Tips:

– Make sure you call the styles before calling less.js
– When you link more than one .less stylesheet each of them is compiled independently. So any variables, mixins or namespaces you define in a stylesheet are not accessible in any other.

Options

You can set up some LESS options by using this code:


less = {
env: "development",
logLevel: 2,
async: false,
fileAsync: false,
poll: 1000,
functions: {},
dumpLineNumbers: "comments",
relativeUrls: false,
globalVars: {
var1: '"string value"',
var2: 'regular value'
},
rootpath: ":/Content/"
};


If you want to know more, check the LESS documentation.