I'm still waiting on the :has selector - if it ever reaches maturity, I'd be using it all over the place
Array.from(document.querySelectorAll(this)).filter(tag => tag.querySelector(that))
I'm using a little plugin to read JS-in-CSS so I can write it from my stylesheet, here's a little more about how that's working, but as long as you could run this helper function on the right events it would mark up elements in the DOM that match our :has() rule and give them unique attributes. Then the function returns a string which is text of a CSS stylesheet, with the rules written targeting the elements with our new unique attributes. As long as you can populate a stylesheet in DOM or CSSOM with the CSS that the function returns it will work: codepen.io/tomhodgins/post/what-is...
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.