Group the selection (is, where)
Let's say we need to select links in several elements:
.product-title a,
.news-title a,
.user-title a {
/* property parameters */
}
To avoid duplicating code, it can be shortened using the :is() or :where() pseudo-class.
/* Option 1 */
:is(.product-title, .news-title, .user-title) a {}
/* Option 2 */
:where(.product-title, .news-title, .user-title) a {}
The difference between :is() and :where() is that :where() does not increase the weight (specificity).
Поддержать автора
Все статьи создаются и поддерживаются одним человеком,
если вам нравится контент, вы можете поддержать автора сайта
