An extension of a dynamically formed selector (freely using the term), as is currently not possible in Less. To support this, there is an open function request . Until it is implemented, here are two solutions to work with.
Option 1:
.hello .hello-world ( test.less), , CSS. .foo, CSS ( (less)), .hello-world, .
test.less:
.hello {
&-world {
color: red;
}
}
rule.less:
@import (less) "test.css";
.foo {
&:extend(.hello-world);
font-size: 20px;
}
CSS:
.hello-world,
.foo {
color: red;
}
.foo {
font-size: 20px;
}
, test.css . , .
2:
, .hello-world, .foo, :
.dummy{
color: red;
}
.hello {
&-world:extend(.dummy) {};
}
.foo:extend(.dummy){
font-size: 20px;
}
(), .
. , , , , , , .