tailwindcss之使用伪元素添加内容的坑:
:deep(.select-none) {
@apply text-[0px];
&::before {
@apply text-base
@apply content-['No results match your search.'];
}
}
报: The content-["No class does not exist. If content-["No is a custom class, make sure it is defined within a @layer directive
:deep(.select-none) {
@apply text-[0px];
&::before {
@apply text-base;
@apply content-['No_results_match_your_search.'];
}
}
原因: Since whitespace denotes the end of a class in HTML, replace any spaces in an arbitrary value with an underscore.
原文: https://tailwindcss.com/docs/content#setting-a-pseudo-elements-content
