-
Notifications
You must be signed in to change notification settings - Fork 0
Less js differences
There are many ways in which dotless offers something more than less.js (see Plugins and Parameters) but this page focuses on differences.
dotless supports comments in more places than less.js, which will throw a parser error in certain situations. However if you keep comments in sensible places – after rules and before the selectors you are unlikely to notice anything.
The following unfixed less.js bugs are fixed in dotless
Cannot compile "@media only screen and (-o-min-device-pixel-ratio: 2/1)"
Added -khtml support for @keyframes
Variable in url(..) not possible
lowercased transform-functions ie: rotateX() becomes rotatex() in mixin
font-face does not work in mixins
as in Bug 619 in less.js
In dotless it is possible to specify named arguments, e.g.
.mixin(@backColor, @foreColor) {
background: @backColor;
color: @foreColor;
}
.mixin(@foreColor:blue, @backColor:red);In 1.3.0.3 better support for for & operator was brought to dotless (see dotless bug). This fixed the following outstanding less.js bugs..
- https://github.com/cloudhead/less.js/issues/774
- https://github.com/cloudhead/less.js/issues/299
- https://github.com/cloudhead/less.js/issues/639
- https://github.com/cloudhead/less.js/issues/704
- https://github.com/cloudhead/less.js/pull/705
- https://github.com/cloudhead/less.js/issues/749
We currently believe their are some scope bugs in less.js because we do not believe the features are by design. In dotless a variable has its own scope and referencing the same variable in different locations shouldn’t cause the variable to be re-evaluated in the context of the caller (that is what functions and mixins are for). This is sumarised in a bug against us.
In less.js you can use the backquote in order to execute JavaScript. This is not supported in dotless.
In dotless we favour the color keyword over the hex code, if one matches. When compressing it chooses whichever is shorter.. e.g. #FFF, #FFFFFF, white then #FFF will be chosen, but in the case of red, the keyword red will be used.
In less.js every colour is replaced with a hex code.
If this produced a problem for someone we would change it.