The :has() pseudo-class, a proposed CSS selector, acts like a parent selector. It enables you to style a parent element based on the presence of a specific child element, a feature that was previously difficult to achieve with pure CSS. This offers significant potential for more efficient and dynamic styling.
Example:
nav:has(ul.active) {
color: gray;
}
In this case, if the nav element contains a ul with the class active, the color of the navbar will change to gray.