Using variable name for selector in less
Yes, this can be done
This works in LESS 1.3.1+. You can vary the string, but this is simply an example of one way it could be done:
LESS
@selector1: ~'#master';
@selector2: ~'@{selector1} #leftcontent';
@selector3: ~'@{selector1} #rightcontent';
@{selector2} div,
@{selector3} div {
background-color: #fff;
}
@{selector2} a,
@{selector3} a {
color: blue;
}
CSS Output is exactly as you show in the question.