Let me provide an example of my desired approach.
:all() {
&,
&:link,
&:visited,
&:active,
&:focus
}
The concept above involves a 'custom selector' that encompasses all pseudo-classes of an anchor tag, excluding :hover.
I envision using it as a selector in this manner:
.menu {
a.top-level:all, span {
color: @dormant-grey;
}
a.top-level:hover {
color: @off-black;
}
}
The desired output would be:
.menu a.top-level,
.menu a.top-level:link,
.menu a.top-level:visited,
.menu a.top-level:active,
.menu a.top-level:focus,
.menu span {
color: #686868;
}
.menu a.top-level:hover {
color: #22282a;
}
Therefore, my question is clear. Is there a method to reuse a selection?
It's important to note that my query pertains to reusing a selection, not just a style. Using mixins for the same purpose would necessitate redundant styling - once for the mixin and again for other selections not covered by the mixin. This repetition has led me to reconsider using mixins altogether.
To reiterate, I am exploring possibilities for reusing a selection. If Less cannot achieve this, is there another language that offers such functionality?