Reputation: 1188
Is it possible to use namespace interpolation in Less ?
@color: "yellow";
#top-yellow {
.square(@param) {
width: @param;
height: @param;
}
}
.example {
#top-@color; // Use of #top-yellow namespace
.square(10px);
}
Thanks !
Upvotes: 1
Views: 51
Reputation: 11820
Use parametric namespace instead (Notice namespaces and mixins are actually the same thing - i.e. the former is a purely logical abstraction).
@color: yellow;
#top(yellow) {
.square(@param) {
width: @param;
height: @param;
}
}
.example {
#top(@color); // use yellow #top namespace
.square(10px);
}
Upvotes: 2