I'm trying to do this:
.a:concat(.b, .c, .d)
Expecting this result:
.a.b, .a.c, .a.d {}
Obviously this won't work since there isn't a function called concat in LESS. Can we achieve this with something else?
Thanks
That is not achieved with a pseudo-class, but with the & character in a nested rule:
.a {
&.b, &.c, &.d {}
}
On an interesting note, there is in fact a pseudo-class being proposed for the upcoming Selectors standard, not as :concat() but as :matches(), with similar syntax. It's unimplemented outside of prefixes at the moment, but in the meantime, this is done a little differently with LESS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With