Problems with less mixing

I am trying to make (I think) a very simple mixin in LESS, and I'm not sure what is going wrong here.

I am compiling with Visual Studio Web Essentials.

So, here is my goal: I need a style that looks like a boostrap control shortcut, except that I want to change some property (let's say an addition):

Here is my LESS:

@import (reference) 'bootstrap/bootstrap.less';
    .my-test-class {
      .control-label;
      padding: 4;
    }

This results in a compilation error: NameError: .control-label undefined.

What am I doing wrong here?

+3
source share
1 answer

, .control-label . , .form-inline .form-horizontal. .form-inline -, .

, , , :

@import (reference) 'bootstrap/bootstrap.less';

.my-test-class {
  .form-horizontal > .control-label;
  padding: 4;
}

, , - , , ( , ) mixin ( (reference) ).

+5

All Articles