less/less.js — pull request #1655 by chipx86 (2013-11-14 11:46:28+00:00)
Title: Support specifying custom variables when calling lessc and less.js.

Both lessc and less.js can now be provided with global variables that
all .less files will have immediate access to. This can be used to
provide, for example, a base path for an `@import`, signed URLs offering
temporary access to an image on S3, or anything else.

lessc has two new parameters, `--global-var` and `--modify-var`. Both take
a value of the form `"varname=value"`. `--global-var` declares variables
immediately before the content of the .less files, and `--modify-var`
declares them after.

`--global-var` is used when rules, imports, or other variables will depend
on the provided variable.

`--modify-var` is used to override a variable declared within the .less
file.

less.js's equivalent for global variables is `less.globalVars`. This can
be set before loading less.js. There is no new equivalent to
`--modify-var`, as less.modifyVars can be used for that purpose.

Implements issue #731.