Less. The dynamic stylesheet language.
APACHE-2.0 License
Bot releases are visible (Hide)
this
pointer so that it is not empty. (@lumburr)@media
queries generated when compiling less file with (reference) to bootstrap (@MoonCoral)Published by iChenLei over 2 years ago
disablePluginRule
flag for render() options (#3710) (@broofa @edhgoose)This was maybe too big a change without some kind of deprecation or conversion.
So for this version, this works again:
.mixin;
This release has 2 breaking changes:
This aligns it with syntax for calling detached rulesets.
Example
.mixin() {}
.mixin; // error in 4.0
Parentheses are required (by default) around division-like expressions, to force math evaluation.
Example:
@ratio_large: 16;
@ratio_small: 9;
/** The following will produce `device-aspect-ratio: 1.77777778` by default in 3.x */
@media all and (device-aspect-ratio: @ratio_large / @ratio_small) {
.body { max-width: 800px; }
}
Produces:
@media all and (device-aspect-ratio: 16 / 9) {
.body {
max-width: 800px;
}
}
You can, of course, get old math behavior. See: http://lesscss.org/usage/#less-options-math
isdefined(@unknown)
)rgb(0 128 255 / 50%)
)Published by lukeapage over 9 years ago
&
now work better\r
newlines now process ok (regression in 2.0.0)Published by lukeapage over 9 years ago
@plugin
directive to load function plugins@import (css)
does not pull the directive above commentsPublished by lukeapage over 9 years ago
Published by lukeapage over 9 years ago
&
) used in sub element expression (e.g. :not(.c_&)
)Published by lukeapage over 9 years ago
Published by lukeapage almost 10 years ago
Published by lukeapage almost 10 years ago
Published by lukeapage almost 10 years ago
Published by lukeapage almost 10 years ago
Published by lukeapage almost 10 years ago
Published by lukeapage almost 10 years ago
some refactoring of browser structure to allow use of api vs normal browser bundle
browser bundle no longer leaks require
browser can now be scoped with just window
browser useFileCache defaults to true, but file cache is now cleared when refreshing or in watch mode
Published by lukeapage almost 10 years ago
Imports are now sequenced and so are consistent (previously some complex projects might end up with occasional different orderings)
Imports with variables are better supported - variables can be specified in sub imports
Support for rebeccapurple
Browser can now accept options as attributes on the script tag and the link tags e.g. <script data-verbose="false" src="less.js"...
adding a .less file extension is done in the abstract file manager so it the behaviour can be overridden by certain file managers
Fixed a bug where unquoted urls beginning // e.g. url(//file/file.less) would be incorrectly interpreted (bug introduced in b-1)
lessc plugins can be a function, used as a constructor as well as an object - this to allow the plugin more flexibility to be used programattically
Published by lukeapage almost 10 years ago
Public Beta / Release Candidate - Feedback welcome For a guide to breaking changes see the v2 upgrade guide
no longer including old versions of less in the repo or npm
not including test less and gradle files in npm
colours now output in the format they are added, so yellow will output yellow, not its hex counterpart
better parsing - better comment support and comments in brackets can now contain comments including quotes.
Removal of dependency on clean-css - install less-plugin-clean-css and use --clean-css to reference plugin
Environment Support - less is now separate from its node and browser environment implementations and adding support for another javascript environment should be straight forward.
Plugin Support - it is now straight forward to add AST manipulations (see less-plugin-inline-images), file managers (see less-plugin-npm-import) and post processors (see less-plugin-clean-css and less-plugin-autoprefix).
We now recommend using less.render and using the parser directly is not in the same way as in v2. It is possible but it would require changes and we do not guarantee it will not be broken in minor version releases.
In the browser, less.pageLoadFinished will be a promise, resolved when less has finished its initial processing. less.refresh and less.modifyVars also return promises.
In the browser, as before less is used as options, however this is now copied to less.options if you need to access after less has run
In the browser, the cache can be overwritten by setting less.cache before less loads. After load less.cache will be the default implementation.
less.js now uses browserify to generate its browser side component
default values for the sourcemap options have been re-done and improved to hopefully mean creating sourcemaps is easier
Many smaller bugfixes and API changes. Please let us know if something you relied on has disappeared or an area should be better documented.