【发布时间】:2020-03-29 18:46:52
【问题描述】:
我正在尝试在 TailwindCSS 中将 @apply 与占位符颜色一起使用,但由于某种原因,尽管我能够将 @apply 与其他属性一起使用,但它似乎不起作用。我还可以将占位符颜色选项用作 CSS 类。它只是不适用于@apply。
@tailwind base;
input {
@apply placeholder-gray-900;
}
@tailwind components;
@tailwind utilities;
通过尝试这个我最终得到了这个错误:
`@apply` cannot be used with `.placeholder-gray-900` because `.placeholder-gray-900` either cannot be found, or its actual definition includes a pseudo-selector like :hover, :active, etc. If you're sure that `.placeholder-gray-900` exists, make sure that any `@import` statements are being properly processed *before* Tailwind CSS sees your CSS, as `@apply` can only be used for classes in the same CSS tree.
【问题讨论】:
标签: tailwind-css