Open whiteinge opened 2 years ago
Here’s a previous issue related too: https://github.com/blakeembrey/free-style/issues/72.
Oh, thanks for the link. I did search the issues before opening this but 'selector list' and 'pseudo class' don't appear in those others and I didn't think to just search for 'comma' :stuck_out_tongue: .
I can definitely appreciate not wanting to introduce a parser. That said, I do wonder if we could get by with a very naive one since, I think, we only care about top-level selector lists. Offhand:
:is()
, :where()
, and more in the Selectors 4 addition.Can you think of anything I'm overlooking? I wonder if it could be as simple as splitting on any commas outside pairs of (
and [
-- and maybe "
and '
too (or will those always appear inside one of the first two?). I'll poke around the spec and some existing parsers.
If a parent style uses a selector list and a child style uses both the parent reference (
&
) and a pseudo class, that pseudo class isn't present on all parent selectors as expected.E.g.:
Produces
.asdf > input, .asdf .foo > input:focus {...}
on the last selector only, and not.asdf > input:focus, .asdf .foo > input:focus {...}
on all selectors as expected.