less.watch()
after the less.js file is added. For enabling the watch mode temporarily, add #!watch
[c]
<script>less = { env: 'development'};</script>
<script src="less.js"></script>
<script>less.watch();</script>
[/c]
dumpLineNumbers
or add the !dumpLineNumbers:mediaquery
to the url as mentioned above.
The option mediaquery
can be used with FireLESS
( similar to SCSS media query debugging format) and the option comment
can be used to display the line numbers in the inline compiled CSS code and also used to display the file information. Options | Type | Default |
---|---|---|
async: Used to check whether the requested import files have the async option or not. | Boolean | false |
dumpLineNumbers: Set this option to add the source line information to the output css file. It helps in debugging a particular rule. | string | ' '(single quotes) |
env: Set the option to run either on development or production. In the case of production, the CSS in the local storage is cached and the messages are not output to the console. eg: less = {env: 'production'}; | string | depends on page URL |
errorReporting: Set the option when the compilation failed. | string | html |
fileAsync: The option is used to set when a page with a file protocol is requested asynchronously. | Boolean | false |
functions: User function and a object type. eg: less = { functions: { myfunc: function() { return new(less.tree.Dimension)(1); } } }; Can be used as a native Less function. eg: .my-class { border-width: unit(myfunc(), px); } | object | User function, keyed by name. |
logLevel: Used to display the amount of logging in the JavaScript console. In the production environment, it is unable to get any logging. 2 - Information and errors 1 - Errors 0 - Nothing | Number | 2 |
poll: Used to measure the time between polls in watch mode. | Integer | 1000 |
relativeUrls: Used to adjust the URLs to be relative and by default the URLs are already relative to the entry Less file and is false. | Boolean | false |
globalVars: The option is set to insert the global variables list into the code. The variables of string type should be given in quotes. eg: less.globalVars = { myvar: "#ddffee", mystr: "\"quoted\"" }; | object | undefined |
modifyVars: The modifyVars option is quite opposite to globalVars option. It puts the declaration at the end of the base file. | object | undefined |
rootpath: Used to add a path at the starting of every URL resource. | string | false |
useFileCache: The option is set to use per session file cache and calls modifyVars in cache less files. It will not retrieve all the less files again. | Boolean | true |