Skip to content

& {...} nested class as a mixin – unspecified behaviour #2453

Open
@tomek-he-him

Description

@tomek-he-him

This works as expected:

.foo {
  .bar.baz;
}

.bar {
  &.baz {
    some: stuff;
  }
}
$ lessc this
.foo {
  some: stuff;
}
.bar.baz {
  some: stuff;
}

And that fails:

.foo {
  .bar.baz;
}

.bar {
  & {
    &.baz {
      some: stuff;
    }
  }
}
$ lessc that
NameError: .bar.baz is undefined in .../that on line 2, column 5:
1 .foo {
2     .bar.baz;
3 }

Funnily, it works when the declarations are the other way round:

.bar {
  & {
    &.baz {
      some: stuff;
    }
  }
}

.foo {
  .bar.baz;
}
$ lessc the-other-way-round
.bar.baz {
  some: stuff;
}
.foo {
  some: stuff;
}

I'm using lessc 2.4.0 (Less Compiler) [JavaScript].

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions