Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Limit the reach of your selectors with the CSS scope at-rule (chrome.com)
3 points by TIPSIO on Jan 3, 2024 | hide | past | favorite | 1 comment


I may have missed it, but what is the difference between `@scope (.card) { img {} }` and `.card img {}`? From an implementation perspective, I can see that scope might be calculated beforehand, so only that tree is searched for `img` elements (which would be faster than the default right-to-left way it's normally don), but is that the only real difference between these two selectors?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: