Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recursive mixin not working in nested rule #644

Open
sebenik opened this issue Jan 16, 2019 · 0 comments
Open

recursive mixin not working in nested rule #644

sebenik opened this issue Jan 16, 2019 · 0 comments

Comments

@sebenik
Copy link

sebenik commented Jan 16, 2019

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%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant