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

Exception when encountering blocks inside a mixin call #282

Closed evalica closed 9 years ago

evalica commented 9 years ago

Not sure if this issue's title is correct so please adjust it as you like.

So after using LESS4J, I've got:

Less4jException: Could not compile less. 4 error(s) occurred:
ERROR 3:22 no viable alternative at input '(' in abstract mixin or namespace (which started at 2:1)
 2: .variations(@extra, @property, @default) {
 3:   .generic-variations(@extra, @default, {
 4:       @{property}: @material-color;

ERROR 3:41 mismatched input '{' expecting '@<variable name>' in abstract mixin or namespace (which started at 3:3)
 2: .variations(@extra, @property, @default) {
 3:   .generic-variations(@extra, @default, {
 4:       @{property}: @material-color;

...

for this kind of code:

// usage: .variations(~" .check", color, transparent);
.variations(@extra, @property, @default) {
  .generic-variations(@extra, @default, {
      @{property}: @material-color;
    });
}

The whole LESS can be found at https://github.com/FezVrasta/bootstrap-material-design/blob/master/less/_mixins-fullpalette.less

For me is not a serious / critical issue since I was just experimenting, but maybe is something you want to get fix.

Thanks for your work.

SomMeri commented 9 years ago

Thank you for the report, I will do bugfixing soon.

evalica commented 9 years ago

Thank you :)

SomMeri commented 9 years ago

Just released 1.12.0 version should have this fixed. If it is not, please re-open the issue.