-
Notifications
You must be signed in to change notification settings - Fork 0
Browser Options
You can set options by setting things on a global LESS object before the script:
<!-- set options before less.js script -->
<script>
less = {
env: "development",
async: false,
fileAsync: false,
poll: 1000,
functions: {},
dumpLineNumbers: "comments",
relativeUrls: false,
rootpath: ":/a.com/"
};
</script>
<script src="less.js"></script>Type: String
Default: development
Environment to run may be either development or production
Type: Boolean
Default: false
Load imports asynchronously.
Type: Boolean
Default: false
Load imports asynchronously when in a page under a file protocol.
Type: Integer
Default: 1000
The amount of time (in milliseconds) between polls while in watch mode.
Type: object
User functions, keyed by name.
Type: String
Default: comments
Or "mediaQuery" or "all".
TODO: need more explaination here.
Type: Boolean
Default: false
Optionally adjust URL's to be relative. When false, URL's are already relative to the entry less file.
Type: String
Default: false
A path to add on to the start of every URL resource.
To enable Watch Mode, development mode must be enabled (less.env). Development mode is set automatically, based on whether the document's URL starts with file:// or localhost.
To get around this, use the following:
<script type="text/javascript">
var less = { env: "development" };
</script>
<script type="text/javascript" src="/lib/less-1.3.0.min.js"></script>Note that the script must be run before the less.js file is included.
This manually puts Less in development mode, and enables watch mode.
- Usage: for an introduction to the language, please visit lesscss.org.
- Developer info: visit the wiki homepage wiki