Skip to content

Parent selectors not working within mixins using (reference) #1979

Closed
@luishdez

Description

@luishdez

Having on mixin.less

.mixin-test() {
  .test {
    color: red;
    &:first-child {
      color: blue;
    }
  }
}

And main.less

@import (reference) "mixin.less";

.mixin-test();

It Outputs:

.test {
  color: red;
}

but if I remove the (reference) it prints

.test {
  color: red;
}
.test:first-child {
  color: blue;
}

lessc 1.7.0 (LESS Compiler) [JavaScript]

Not sure if it's related to: #1851

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions