LESS declaration block as mixins arguments

.some-mixin(
@titleFont: '',
@bodyStyle: {},
) {
& > .title {
font: @titleFont;
}
& > .body {
@bodyStyle();
}
}
.some-component {
.some-mixin(
@titleFont: bold 1.5em Helvetica,
@bodyStyle: {
color: gray;
},
);
}

compiles to:

.some-component > .title {
font: bold 1.5em Helvetica;
}
.some-component > .body {
color: gray;
}

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.