【发布时间】:2021-12-06 20:39:56
【问题描述】:
我第一次在顺风 css 项目上工作,它给我带来了这个我无法理解的错误,我正在使用 React:
Syntax error: The `dark:bg-gray-800` class does not exist. If `dark:bg-gray-800` is a custom class, make sure it is defined within a `@layer` directive. (8:5)
index.css:
@import-normalize;
@tailwind base;
@tailwind components;
@layer components {
.sidebar-icon {
@apply relative flex items-center justify-center
h-12 w-12 mt-2 mb-2 mx-auto
bg-gray-400 hover:bg-green-600 dark:bg-gray-800
text-green-500 hover:text-white
hover:rounded-xl rounded-3xl
transition-all duration-300 ease-linear
cursor-pointer shadow-lg ;
}
【问题讨论】:
标签: css frontend tailwind-css