Код: Выделить всё
@layer components {
/* text-links is default color */
.link-default {
@apply text-links no-underline;
}
// ...
/* text-headings color wins, because link-nav class is defined after */
.link-nav {
@apply text-headings whitespace-nowrap underline-offset-4 text-lg;
@apply hover:text-links-hover;
@apply focus:text-links-hover focus:underline;
@apply active:text-links-hover;
}
}
Код: Выделить всё
/* text-links wins but it shouldn't */
@utility link-default {
@layer components {
@apply text-links no-underline;
}
}
// ...
@utility link-nav {
@layer components {
/* here, specificity fails, text-headings */
@apply text-headings whitespace-nowrap underline-offset-4 text-lg;
@apply hover:text-links-hover;
@apply focus:text-links-hover focus:underline;
@apply active:text-links-hover;
}
}
Как правильно контролировать специфичность в утилитах V4?
Подробнее здесь: https://stackoverflow.com/questions/794 ... nges-in-v4