Week 253 was posted by Charanjit Chana on 2022-08-29.
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.
- Day 1
- Day 2
- Day 3
- Day 4
- Day 5
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.