nthChild
nthChild

Reputation: 699

Using less.css and Twitter Bootstrap 3 - mixins not working

Alrighty, so I am trying to add classes to my page via css. Below is an example of the less.css file I am writing:

.someClass {
    .col-sm-6;
}

I swear this worked before, but for whatever reason, my compiler throws an error:

".col-sm-6 is undefined"

Compiler: WinLess

Essentially I'm just trying to assign the col-sm-6 class to a div for width/float etc... Please let me know if you can think of any reasons this wouldn't work.
Thanks!

Upvotes: 0

Views: 456

Answers (1)

ScottS
ScottS

Reputation: 72261

Bootstrap 3 makes these class names via a dynamic mixin, so they are not directly accessible as mixins themselves (dynamically generated class names are not currently able in LESS to be accessed as mixins). Instead, you need to call the mixin to generate the code by doing this:

.someClass {
    .make-sm-column(6);
}

Upvotes: 3

Related Questions