Christian Hammond f66757554f Fix synchronously loading/applying stylesheets on page load.
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.
2015-04-28 02:08:39 -07:00
2015-03-15 09:59:18 +00:00
2015-04-03 08:33:21 +01:00
2015-01-30 18:28:02 +00:00
2015-04-03 09:53:16 +01:00
2015-04-19 19:49:27 +04:00
2015-01-13 20:32:47 -08:00
2015-01-30 20:41:25 +00:00
2015-01-27 22:02:05 +00:00
2014-10-19 18:48:40 +01:00
2015-03-12 19:17:42 +00:00
2015-04-03 09:53:16 +01:00
2014-11-09 08:50:32 +00:00
2014-03-02 14:06:26 +02:00
2015-04-11 12:42:57 -04:00
2014-06-10 19:30:21 +01:00
2013-10-27 15:27:59 +01:00
2013-10-27 15:27:59 +01:00
2015-03-30 04:38:36 +04:00
2014-11-09 08:50:32 +00:00
2015-04-03 09:53:16 +01:00
2015-04-23 17:33:35 +00:00

npm version Build Status Dependencies devDependency Status optionalDependency Status Sauce Test Status Build status

Less.js

Join the chat at https://gitter.im/less/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:

More information

For general information on the language, configuration options or usage visit lesscss.org.

Here are other resources for using Less.js:

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.

Description
No description provided
Readme 56 MiB
Languages
JavaScript 64.7%
Less 24.5%
CSS 9.2%
Shell 1.3%
TypeScript 0.2%