
:has is an unforgiving selector
See ::scoobydoo
in there? That’s totally invalid. A forgiving selector list ignores that bogus selector and proceeds to evaluate the rest of the items as if it were written like this:
There’s a bit of a workaround for this. Remember, :is()
and :where()
are forgiving, even if :has()
is not. That means we can nest either of the those selectors in :has()
to get more forgiving behavior:
Which one you use might matter because the specificity of :is()
is determined by the most specific item in its list. So, if you need to something less specific you’d do better reaching for :where()
since it does not add to the specificity score.
We updated a few of our posts to reflect the latest info. I’m seeing plenty of others in the wild that need to be updated, so just a little PSA for anyone who needs to do the same.
If you need help creating a digital marketing strategy for your business, don’t hesitate to contact one of Digidude’s consultants.
Post a Comment
You must be logged in to post a comment.