I've covered the :has() selector in CSS a few times now, but I'm finding it hard not to get excited about it now.
There's been a real surge of interesting articles and demos that I've seen on Twitter and I thought I'd share a couple of the tweets I've seen over the past couple of weeks so that you can get excited too.
Let's start with a tweet from @jensimmons that links through to a comprehensive article on the :has() selector:
Jen followed up with 5 days of tweets giving a bit more context and tweet-sized examples.
Second tweet is from @jh3yy with this demo that takes advantage of the :is() and :has() selectors:
CSS Tip! 🚀 You can select the previous siblings of an element with :has() to create cool hover effects like this OS dock🔥 No JS 😎View on twitter
While I'd have truly loved to have had a parent selector of some sort, especially as jQuery came along and spoiled us with the .parent() method, this really is a great case of better late than never.
|More from 1 Thing A Week|
|« My iPhone 14 Pro wishlist||How to implement the Web Share API on your website||There's always room for improvement||Food Wars »|