Sometimes i need to target descendant elements but also the element itself.
Would be great if i had a single selector for this
button.inverted,
.inverted button {
color:white;
background:black;
}
Maybe something like this?
.inverted | button {
color:white;
background:black;
}
other situations:
#component .item | .highlight
is equivalent to
#component .item .hightlight, #component .item.hightlight
.inverted | button span
is equivalent to
.inverted button span, button.inverted span
In short: the “optional descendant selector” combines the “descendant selector” and the combination of the surounding compound selectors.
Maybe its to complicated mixing “compound Selectors” and “complex selector”…?