:has() selector
CSS selector that matches an element's parent based on its children — the long-awaited "parent selector".
article:has(img) picks <article> elements containing an image. li:has(> ul) = a list item with a submenu. Available since 2023 in all modern browsers. Replaces piles of JavaScript tricks.