3 ms·
>The only missing part from your example is supporting custom properties in selectors I figured it was implied some rules would have to be made which might be
by bryanrasmussen 4y ago
>The only missing part from your example is supporting custom properties in selectors
I figured it was implied some rules would have to be made which might be properties used in selectors are scoped to ancestors of element.
>I'm not sure I totally understand the specifics of the example
example is probably too fanciful but assuming you have a match of selector
.modal .message .error
then element with class user which is on a totally different part of the page - like
body
header
....stuff .user
/header
article
section
.modal .warning .error
then user has color red. Do I personally want this, not much, just considering the people who sometimes say they want if ( selector exists) then bunch of css.
another more likely usage for something like this (a match function that takes a selector) might be the various CSS logical operations things people do sometimes https://css-tricks.com/logical-operations-with-css-variables/ https://css-tricks.com/logical-operations-with-css-variables...
however, as I noted before I don't think it makes sense for css performance reasons, despite how interesting/amusing I might find the idea.