-
Notifications
You must be signed in to change notification settings - Fork 756
Description
In Lists, we've resolved that ::before and ::after can be set to "display: list-item", thus generating markers. However, per Selectors grammar, it's not valid to then write a selector like ol::before::marker. (You can stack pseudo-classes after your pseudo-element, but not more pseudo-elements.)
This seems unfortunate; if a ::before can generate a marker, you should be able to style that marker.
Additionally, I know that WebKit-derived browsers, at least, do allow pseudo-element stacking, to handle styling some of the UA-specific pseudo-elements.
So, we should change Selectors grammar to allow stacking multiple pseudo-elements in a single compound selector. (Individual grammar restrictions will still restrict what sort of stacks are valid; ::before::before will be an invalid selector, just like ::before:invalid is invalid today even tho ::before:hover is valid.)
Since certain pseudo-classes are reasonable to apply to either of the pseudo-elements in the stack, the two need to be arbitrary interleavable. (For example, ::before:hover::marker.) This gives us a grammar of:
<compound-selector> = [ <type-selector>? <subclass-selector>*
[ <pseudo-element-selector> | <pseudo-class-selector> ]* ]!