Post

CSS' `:has()` pseudo-class is powerful stuff, and even moreso when you combine it with classic techniques like quantity queries and a mobile-first mindset. I wrote about it for @piccalil.li! piccalil.li/blog/making-...

piccalil.liMaking content-aware components using CSS :has(), grid, and quantity queriesEric Bailey teaches us how to make a hyper-resilient component that responds not only to the container, but other languages too.

17 reposts73 likes

Wow. Mixing new features with clever selectors in very useful ways. Also showing some love for the lang attribute and — out of nowhere — mentioning the absolute pain that are closed compound words in German. Great read!

Thanks for reading it! I’m honestly of the school of thought that selector complexity is a bit of a red herring when compared to the JS payload, unless it’s something that really tanks LCP or the like.