The :has() pseudo-class in CSS lets you style a parent element based on its child elements. This means you can change how a parent looks if it has kids that meet certain criteria.
One practical use is to display error messages more clearly. You can make a parent element look different, like changing colors, when there's an error message inside it.
This technique also helps with accessibility. You can use it to highlight parent elements for users who may need visual signals, based on child elements with special attributes.
You can easily customize scrollbars using CSS with pseudo-elements. This lets you change the size and color to match your site's design.
Using different pseudo-elements, you can style the scrollbar, track, and thumb for a more appealing look. Each part can have its own styles and hover effects.
These custom scrollbar styles mainly work in WebKit browsers like Safari, so you might need other methods for broader browser support.