mirror of
https://github.com/less/less.js.git
synced 2026-01-23 06:07:56 -05:00
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 requivalent to --modify-var, as less.modifyVars can be used for that purpose.