SomMeri / less4j

Less language is an extension of css and less4j compiles it into regular css. Less adds several dynamic features into css: variables, expressions, nested rules, and so on. Less was designed to be compatible with css and any correct css file is also correct less file.
145 stars 47 forks source link

Less4js is unable do compile code that less.js can #307

Closed diorcety closed 8 years ago

diorcety commented 8 years ago

I'am using Jawr, which used to depend on less.js until a recent version. I'm trying to migrate to the last version which uses less4j. I fall on a issue with the following code

.flex(@display:flex) {
    display: @display;
    display:-ms-@display;
}
[INFO] ERROR 85:5 no viable alternative at input 'display' in abstract mixin or namespace (which started at 83:1)
[INFO]  84:     display: @display;
[INFO]  85:     display:-ms-@display;
[INFO]  86: }
[INFO] 
[INFO] ERROR 85:5 no viable alternative at input 'display' in ruleset (which started at 85:5)
[INFO]  84:     display: @display;
[INFO]  85:     display:-ms-@display;
[INFO]  86: }
SomMeri commented 8 years ago

It seems that issue was fixed in the meantime. Both latest less4j master and less.js 2.5.3 compile it to

div {
  display: flex;
  display: -ms- flex;
}

I will do new release later this week or monday. If it still does not work after that for you, let me know.

Side note: both have space between -ms- and flex. If it is not intentional use this: display: ~"-ms-@{display}"; - it produces -ms-flex without space in both less.js and less4j.