Can something like this be written using the :is()
pseudo-class?
div p,
div p::before,
div p::after {
/* selectors */
}
I tried this but it didn't work:
div :is(p, p::before, p::after) {
/* selectors */
}
No you cannot.
Pseudo-elements cannot be represented by the matches-any pseudo-class; they are not valid within
:is()
. ref