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

Losing wildcard selector inside mixins with ampersand #3316

Open
minimit opened this issue Oct 5, 2018 · 2 comments
Open

Losing wildcard selector inside mixins with ampersand #3316

minimit opened this issue Oct 5, 2018 · 2 comments

Comments

@minimit
Copy link

minimit commented Oct 5, 2018

Using gulp-less v4.0.1, so with less v2.6.x || v3.7.1
In this particular case the * selector gets lost in the compiling the mixin:

Example

.nth-child(@child, @start, @increment, @decrement, @rules) when (@child > 0) {
  .nth-child(@child - 1, @start, @increment, @decrement, @rules);
  &:nth-child(@{child}) {
    @rules();
  }
}

@animation-delay: { animation-delay: @start + (@child * @increment) - (@child * @decrement); };


.content > * {
  animation-delay: 150ms; // @start + @child * @increment
  .nth-child(@child:3, @start:0ms, @increment:50ms, @decrement:0ms, {
    @animation-delay();
  });
}

Result

.content > * {
  animation-delay: 150ms
}
.content > :nth-child(1) {
  animation-delay: 50ms
}
.content > :nth-child(2) {
  animation-delay: .1s
}
.content > :nth-child(3) {
  animation-delay: 150ms
}

Expected Result

.content > * {
  animation-delay: 150ms
}
.content > *:nth-child(1) {
  animation-delay: 50ms
}
.content > *:nth-child(2) {
  animation-delay: .1s
}
.content > *:nth-child(3) {
  animation-delay: 150ms
}
@minimit
Copy link
Author

minimit commented Oct 5, 2018

works anyway without *, I close the issue

@minimit minimit closed this as completed Oct 5, 2018
@matthew-dean
Copy link
Member

Hmm, It's still unexpected. I think it's worth re-opening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants