Starting in 2.0, stylesheet loading became asynchronous, through the usage of promises for both calculating the list of stylesheets and the initial call to less.refresh(). This resulted in visual issues while loading on some browsers (noticed in Firefox and Safari), along with breakages of any custom JavaScript that depended on the computed style of elements on the page, due to race conditions. This change preserves the promise for initial page loading, in order to retain support for less.pageLoadFinished, but immediately executes the stylesheet scan (through a new less.registerStylesheetsImmediately function) and the less.refresh() call. That resulting behavior matches versions of less prior to 2.0. This unveiled a regression in registering functions, both in the browser and in unit tests, that was not previously noticed due to the asynchronous load. Registered functions would have a 'less' variable set to the less options, and not less itself, when not going through the asynchronous loading mode. This meant that both unit tests and real-world function registration would break when the sync page loading was fixed. Overriding window.less to point to the actual less module and not less.options during bootstrap fixes this. This fixes #2317.
Less.js
The dynamic stylesheet language. http://lesscss.org.
This is the JavaScript, official, stable version of Less.
Getting Started
Options for adding Less.js to your project:
- Install with npm:
npm install less - Download the latest release
- Clone the repo:
git clone https://github.com/less/less.js.git
More information
For general information on the language, configuration options or usage visit lesscss.org.
Here are other resources for using Less.js:
- stackoverflow.com is a great place to get answers about Less.
- Less.js Issues for reporting bugs
Contributing
Please read CONTRIBUTING.md. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Reporting Issues
Before opening any issue, please search for existing issues and read the Issue Guidelines, written by Nicolas Gallagher. After that if you find a bug or would like to make feature request, please open a new issue.
Please report documentation issues in the documentation project.
Development
Read Developing Less.
Release History
See the changelog
License
Copyright (c) 2009-2014 Alexis Sellier & The Core Less Team Licensed under the Apache License.