less / less.js

Less. The dynamic stylesheet language.
http://lesscss.org
Apache License 2.0
16.99k stars 3.41k forks source link

Mixin followed by !important is not correctly compiled #3747

Open anamihajlovic opened 1 year ago

anamihajlovic commented 1 year ago

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

iChenLei commented 1 year ago

You can check it on less online playground.

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