TLDR Web Dev · ARTICLES & TUTORIALS
CSS :HAS() INTERACTIVE GUIDE
Summary from the TLDR Web Dev newsletter
The CSS :has() selector is a method for targeting and styling elements based on the presence of specific descendants. It opens up a wide range of new possibilities that weren't possible with traditional CSS selectors. For example, it can be used to customize file icons based on their extension without JavaScript and change a modal’s appearance based on certain actions.