leafo / lessphp

LESS compiler written in PHP

Home Page:http://leafo.net/lessphp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

recursive mixin not working in nested rule

sebenik opened this issue · comments

Input:

.nested-class(4);

.nested-class(@n, @i: 1) when (@i =< @n) {
  .class {
    .nested-class(@n, (@i + 1));
    width: (@i * 100% / @n);
  }
}

Expected output:

.class {
  width: 25%;
}
.class .class {
  width: 50%;
}
.class .class .class {
  width: 75%;
}
.class .class .class .class {
  width: 100%;
}

Wrong output of lessphp:

.class {
  width: 16.666666666667%;
}
.class .class {
  width: 33.333333333333%;
}