“Quantity Queries” are very easy in CSS now that we have :has().

You can just check if an element, for example, has a 10th child, like `.el:has(:nth-child(10))`, and now you know there are *at least* 10 children. Trivial.

frontendmasters.com/blog/quantity-โ€ฆ

Plus, you could use :nth-of-type to check if an <article> has more than X <h2>'s, or the like. Slightly more fancy quantity testing.

260 likes ยท 35 retweets Original on Twitter