less Mixins Prevent a mixin definition from appearing in the compiled CSS file

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

.default-settings() {
  padding: 4px;
  margin: 4px;
  font-size: 16px;
  border: 1px solid gray;
}

#demo {
  .default-settings;
}

The above example when compiled would only produce the following output. The .default-settings() mixin definition would not be output in the compiled CSS file because parenthesis is added after it.

#demo {
  padding: 4px;
  margin: 4px;
  font-size: 16px;
  border: 1px solid gray;
}

If these parenthesis are not attached, the Less compiler will treat the mixin definition also as CSS selector and so will print it also in the output CSS file.



Got any less Question?