:is vs :where

hey, what are some example use cases where :is and :where do separate jobs? from what i've seen they mostly do the same thing? and the mdn docs give the exact same code in the examples for both of these? an example of this is
:is(h1) {
color: red;
}

:where(h1) {
color: red;
}
:is(h1) {
color: red;
}

:where(h1) {
color: red;
}
Thanks in advance.
6 Replies
ἔρως
ἔρως2mo ago
when you don't want to change the specificity, you use :where()
snxxwyy
snxxwyy2mo ago
ahh okay makes sense, thanks
ἔρως
ἔρως2mo ago
you're welcome
ἔρως
ἔρως2mo ago
https://www.youtube.com/watch?v=3ncFpP8GP4g <-- here's a good video for you
Kevin Powell
YouTube
The new CSS pseudo-classes explained - :is() :where() :has()
Every time I mention :is() and :where() people tell me they’ve never seen them before, and with browser support being pretty good for them now (over 92%), I figured I should spread the word once again, and while I was at it, it seemed like a good time to talk about :has() as well (which is over 83% already!). 🔗 Links ✅ More on :has(): https://y...
snxxwyy
snxxwyy2mo ago
oh i didn't know he made one, i'll check that out
ἔρως
ἔρως2mo ago
check it
Want results from more Discord servers?
Add your server