Ultimately I'm trying to accomplish the following styles with LESS.
<div class="filter btn-group">
<button class="btn btn-default" type="button" data-filter="*">show all</button>
<button class="btn btn-default" type="button" data-filter=".cd">CD</button>
<button class="btn btn-default" type="button" data-filter=".vinyl">Vinyl</button>
</div>
I have the following HTML
<div class="filter">
<button type="button" data-filter="*">show all</button>
<button type="button" data-filter=".cd">CD</button>
<button type="button" data-filter=".vinyl">Vinyl</button>
</div>
And I have this in a LESS file with imports of Bootstrap 3
.filter {
.btn-group;
button {
.btn;
.btn-default;
}
}
When adding .btn and .btn-default to the button works just fine. But adding .btn-group to the wrapper ".filter" doesn't work. I can't figure out what I'm doing wrong. If I add the class .btn-group manually to the
class="filter btn-group"It works.
.btn-group,.btnand.btn-defaultare are just plain CSS classes not meant to be used as mixins (even if Less allows you do do this). You do get a copy of properties of these particular CSS classes within your own classes but you don't get properties of other Bootstrap classes containing.btn-group,.btnetc. selectors. Bootstrap's.btn-group > .btnclass styles are defined on their own and neither.btnnot.btn-groupcopy those styles into your.filter buttonclass. - seven-phases-max