Reputation: 378
Hi how to convert adjacent sibling selectors from css to less
Example:
#block .tall + p {
[some attributes]
}
If I convert this to less like so
#block {
.tall {
+ {
p {
}
}
}
}
I get ParseError: Unrecognised input in + {
When I try to use &+& {
in conversion back to css it becomes
#block .tall + #block .tall p
Any help would be awesome. Thanks.
Upvotes: 2
Views: 1797
Reputation: 58462
You need to put the p
on the same line as the +
Otherwise you are saying adjacent to nothing and the p is the child of that adjacent nothing:
#block {
.tall {
+ p {}
}
}
Upvotes: 4