DEV Community

Discussion on: DISCUSS: If there's one CSS feature you could add, what would it be?

Collapse
 
alohci profile image
Nicholas Stimpson • Edited

The problem with a has() selector, according to Tab Atkins, is that means that any DOM mutation will cause the cascade for the entire document to have to be rebuilt, which is much too slow. There's some suggestions that a has-child() selector might be possible, but it still increases the sub-tree that needs its cascade rebuilt from everything under the mutated element's parent, to everything under the mutated element's grandparent, which may still be regarded as too great. So don't hold your breath waiting for support.

Thread Thread
 
jmdejager profile image
🐤🥇 Jasper de Jager

But if I was a wizard.. 🧙‍♂️✨ 😊