Add a Parent '&' to a variable using LESS

1

I have a problem but I do not know if it's possible, I'm trying to edit some class by putting a & following the example:

.bcolor(@prefix, @suffix) {
    .@{prefix}red@{suffix} {
        background-color: red;
    }
    .@{prefix}blue@{suffix} {
        background-color: blue;
    }
}

table {
  &.bcolor {
    .bcolor(bc-, ~">tbody>tr");
  }
}

That's fine, but the answer is this:

table.bcolor .bc-red>tbody>tr {
  background-color: red;
}
table.bcolor .bc-blue>tbody>tr {
  background-color: blue;
}

I would need the answer like this:

table.bcolor.bc-red>tbody>tr {
  background-color: red;
}
table.bcolor.bc-blue>tbody>tr {
  background-color: blue;
}

But every time I add% w / o to a variable of the error, follow the example:

table {
  &.bcolor {
    &.bcolor(bc-, ~">tbody>tr");
  }
}
    
asked by anonymous 21.08.2016 / 00:48

0 answers