3 ms·
Excited to finally have a parent selector, but this feels like a major footgun that will promote brittle DOM specific CSS.
by ramesh31 4y ago
Excited to finally have a parent selector, but this feels like a major footgun that will promote brittle DOM specific CSS.
- WalterGR 4y ago:has() sounds amazing on the surface. I’d be interested in a good advantages / disadvantages overview if anyone :has() a link. Edit: Useful: https://caniuse.com/?search=has https://caniuse.com/?search=has
- clairity 4y agothere are a bunch of good articles out there on :has() now, like this one: https://www.smashingmagazine.com/2021/06/has-native-css-parent-selector/ https://www.smashingmagazine.com/2021/06/has-native-css-pare... i've been experimenting with it on safari tech preview, and it really lets you do many things that were previously impossible or unacceptably brittle. i love it. same with container queries. have been experimenting, it's really nice compared to page grids and breakpoint hell.
- nicoburns 4y agoOhhh, I didn't know that container queries are finally being implemented. I'd given up on them as something that would be great but didn't look like they were going to happen.
- arrakeen 4y agoit's extremely useful for defining ublock origin rules
- WalterGR 4y agoSo far I've only used it in TamperMonkey. Between your comment and culturestate's[0], you may be on to something. [0] https://news.ycombinator.com/item?id=31369223 https://news.ycombinator.com/item?id=31369223
- culturestate 4y ago> this feels like a major footgun that will promote brittle DOM specific CSS I can’t say I’ve really considered this in any depth, but my very first thought when I saw :has() was “finally, I can fix those last stupid bugs in my HN userstyle.” So…you may be on to something.