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

Mixin followed by !important is not correctly compiled

Open anamihajlovic opened this issue 3 years ago • 1 comments

Hi,

I have noticed a inconsistency between the documentation and the functioning of less.

In the documentation, adding !important to the mixin should result in the !important being added to all the css declarations inside the mixin. However, this is not the case. Upon compiling, the css does not contain the !important.

image

anamihajlovic avatar Aug 29 '22 13:08 anamihajlovic

You can check it on less online playground.

.foo (@bg: #f5f5f5; @color: #900) {
  background: @bg;
  color: @color;
}
.unimportant {
  .foo();
}
.important {
  .foo() !important;
}

iChenLei avatar Aug 29 '22 14:08 iChenLei