Nested pseudoclasses in Less css
I am trying to use LESS CSS to write my CSS but i got a problem with nested pseudoclasses I
.class1 {
&:nth-of-type(2n) {
.class2{
}
开发者_开发问答 }
}
the output is:
.class1.class2:nth-of-type(2n) {}
but I want to have this:
.class1:nth-of-type(2n) .class2{}
Any ideas?
Not an issue. You probably had a version of LESS CSS that did not produce the correct code. Try the online less converter and see that it works fine. Here is what I get:
(in)
.class1 {
&:nth-of-type(2n) {
.class2{
x:1;
}
}
}
(out)
.class1:nth-of-type(2n) .class2 {
x: 1;
}
精彩评论