Why use :where(html)? #332
-
I think open-props is an awesome library/resource. Recently I've been poking around in the source to pick up whatever tips and tricks I can and I noticed that all properties are declared on the selector 🍻 again for putting out such a great library. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi! Thanks for checkin in 🙂 Everything is wrapped in Glad you're diggin the lib! <3 |
Beta Was this translation helpful? Give feedback.
Hi! Thanks for checkin in 🙂
Everything is wrapped in
:where()
so you as a consumer of the library won't ever have to battle the specificity to overwrite things with your own custom values. The props or normalize load in and don't require any battles, making itself weak instead of strong with specificity. Same with the choice for:where(html)
, it's just weaker in intention, like good faith towards this being helpful and not intrusive. Really it could be:where(:root)
and nothing would change, but yeah, it's the intention of being a subservient library.Glad you're diggin the lib! <3