The :is() pseudo-class takes a forgiving selector list and matches
any element that can be selected by one of the selectors in that list.
It works like the
CSS :is() selector
and is useful for writing compact selectors.
Syntax
:is(<forgiving-selector-list>)The selector list is forgiving — any invalid selectors in the list are silently ignored rather than causing the entire selector to fail.
Examples
Compact selector lists
Without :is():
$ vlt query ':root > [name=react], :root > [name=vue], :root > [name=svelte]'With :is():
$ vlt query ':root > :is([name=react], [name=vue], [name=svelte])'Both queries produce the same result — direct dependencies named
react, vue, or svelte.
Forgiving behavior
Invalid selectors in the list are ignored:
$ vlt query ':is([name=react], :nonexistent, [name=vue])'This still matches react and vue — the :nonexistent pseudo-class
is silently skipped.