- From: Eric Willigers via GitHub <sysbot+gh@w3.org>
- Date: Fri, 07 Dec 2018 05:09:10 +0000
- To: public-css-archive@w3.org
> However, this doesn't allow styling of the parent based on the number of children. Note that `:has` [cannot](https://drafts.csswg.org/selectors-4/#profiles) be used in style rules. It can be used by script: ``` const parents = document.querySelectorAll('a:has(> img)'); for (let parent of parents) { const numChildren = parent.querySelectorAll('* > img').length; if (numChildren > ...) parent.style. ... = ...; else ... } ``` -- GitHub Notification of comment by ewilligers Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1547#issuecomment-445124500 using your GitHub account
Received on Friday, 7 December 2018 05:09:12 UTC