Skip to content

Instantly share code, notes, and snippets.

@jonschlinkert
Created March 14, 2013 05:21
Show Gist options
  • Save jonschlinkert/5159015 to your computer and use it in GitHub Desktop.
Save jonschlinkert/5159015 to your computer and use it in GitHub Desktop.
preparing some docs for the website and wiki

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>

env

Type: String Default: development

Environment to run may be either development or production

async

Type: Boolean Default: false

Load imports asynchronously.

fileAsync

Type: Boolean Default: false

Load imports asynchronously when in a page under a file protocol.

poll

Type: Integer Default: 1000

The amount of time (in milliseconds) between polls while in watch mode.

functions

Type: object

User functions, keyed by name.

dumpLineNumers

Type: String Default: comments

Or "mediaQuery" or "all". TODO: need more explaination here.

relativeUrls

Type: Boolean Default: false

Optionally adjust URL's to be relative. When false, URL's are already relative to the entry less file.

rootpath

Type: String Default: false

A path to add on to the start of every URL resource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment