less.js icon indicating copy to clipboard operation
less.js copied to clipboard

Mixins with parameters do not work properly

Open Jagget opened this issue 3 months ago • 3 comments

To reproduce:

Try this code in Playground:

@width: 125px;

.mixin(@container-name; @bp) {
  @container @container-name (width < @bp) {
    display: none;
  }
}

.foo {
  .mixin(name, @width);
  color: red;
}

Current behavior:

Does not compile with an error

variable @bp is undefined

Expected behavior:

Compiles to

.foo {
  color: red;
}
@container name (width < 125px) {
  .foo {
    display: none;
  }
}

Environment information:

  • less version: 4.4.2

Jagget avatar Oct 21 '25 20:10 Jagget