With .class &
I can add rules adds a parent-class to the path, but it always put that parent in the front of all parents.
Is there someway to add a parent in the middle somewhere.
I tried using a variable for it like this: Example less:
@color: "";
.a {
.b @color {
.d {
.e {
font-size: 2em;
color: black;
@color: ".yellow";
color: yellow;
@color: ".red";
color: red;
@color: "";
}
.f {
font-size: 1.2em;
}
}
}
}
Expected output:
.a .b .d .e {
font-size: 2em;
color: black;
}
.a .b .yellow .d .e {
color: yellow;
}
.a .b .red .d .e {
color: red;
}
.a .b .d .f {
font-size: 1.2em;
}
But that didn't work.
So how do I write something that generates that output in a good way. I'd like to have the color variation close to the default color. And I'd like to not have unnecessary duplicated code = not reseting the font-size to the same value for each color.