Less.js Loop for manipulating adjacent siblings. Defaults to add the style to all X number of siblings as specified in the call.
.testcase {
.adjacents-content() {
display: inline;
}
.adjacents(4, ".item" );
}Will output to
.testcase + .item {
display: inline;
}
.testcase + .item + .item {
display: inline;
}
.testcase + .item + .item + .item {
display: inline;
}
.testcase + .item + .item + .item + .item {
display: inline;
}Alternately you can target just a specific sibling:
.testcase {
.adjacents-content() {
display: inline;
}
.adjacents(4, ".item", false );
}Outputs
.testcase + .item + .item + .item + .item {
display: inline;
}