w3c is iffy on complex vs compound in nth-child and possibly other lists
See original GitHub issueI’m not sure if this will affect us, but I figure I’ll create an issue to track this. It seems that there was some concern with whether :nth-child(an+b of)
should support compound or complex selectors. The idea is that it may be easier to get compound out the door first for L4, and then complex would be deferred to L5. The discussion seems to question others as well such as :is()
, :not()
, etc.
If they defer to L5, I don’t think anything for us will change. If that is the case, we’ll just say we support L5. If they completely abandon complex in one or more, we may have to downgrade complex support to compound.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Selectors Level 4 - W3C
A given element is said to match a complex selector when there exists a list of elements, each matching a corresponding compound selector...
Read more >nth-child() - CSS: Cascading Style Sheets - MDN Web Docs
:nth-child( <nth> [ of <complex-selector-list> ]? ). Keyword values. odd. Represents elements whose numeric position in a series of siblings is ...
Read more >How nth-child Works - CSS-Tricks
It boils down to what is in between those parentheses. nth-child accepts two keywords in that spot: even and odd. Those should be...
Read more >Complex vs Compound Selectors | Miriam Eric Suzanne
And we can string all that together into selector lists, targeting multiple elements based on a variety of properties and relationships. It's a ......
Read more >Untitled
Bahia ba vs villa nova mg, Fhea 2015, Cincinnati enquirer classifieds pets, Hanford newsweek! Keski-suomen osuuspankki tapahtumat, David barton gym chicago ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Agreed.
Ugh, I think I generally do pretty good at allowing comments, but yeah, I don’t support that. I think I only allow them in cases where whitespace is acceptable, which is like 99% of the cases, but apparently not all of them 🙂 .
Yeah, if you have to parse all valid CSS, which it sounds like you do, you have to look for that kind of stuff and have a finer resolution of how you tokenize. In my case, I’m close enough to be usable for the cases of my users.
This conversation reminded me that the documentation for this has already been updated mentioning our current direction. We mention the differences between level 3 and level 4 and mention that we follow the discussed level 5 direction. This issue can actually be closed as all of this is now addressed.
I think even if the CSSWG were to completely drop complex selectors, we might keep them around in Soup Sieve simply for their usefulness. While we strive to follow the spec, we are not completely bound to it as we allow for things like
:contains()
etc.