Información del post ⇣

:where

:where() es una función que toma una lista de selectores como argumentos y selecciona cada uno de los elementos de la lista.

The :where() CSS pseudo-class function takes a selector list as its argument, and selects any element that can be selected by one of the selectors in that list.

Donde antes escribíamos:

main h2,
main h3 {
    margin-block-start: 2rem;
    margin-block-end: 1rem;
}

Ahora escribiremos:

:where(h2, h3) {
    margin-block-start: 2rem;
    margin-block-end: 1rem;
}

Las ventajas de usar :where():

Necesito especificidad

Entonces usa :is().

:is(h2, h3) {
    margin-block-start: 2rem;
    margin-block-end: 1rem;
}

Soporte

Data on support for the css-matches-pseudo feature across the major browsers from caniuse.com


Links relacionados