小编Deb*_*aha的帖子

Tailwind CSS - 类不存在错误

我是 Tailwind CSS 新手。我在构建 React 项目时遇到此错误:

该类hover:不存在。如果hover:是自定义类,请确保它是在@layer指令中定义的。

我在 StackOverflow 上发现了类似的问题,但它对我没有帮助。谁能告诉我为什么会发生这种情况?

//Index.css 
@tailwind base;
@tailwind components;
@tailwind utilities;


@layer components {
    .btn-purple {
        @apply px-4 py-1 text-sm text-purple-600 font-semibold border border-purple-200 rounded-full hover: text-white hover:bg-purple-600 hover:border-transparent focus:outline-none focus:ring-2 focus:ring-purple-600 focus:ring-offset-2;
    }
}


Run Code Online (Sandbox Code Playgroud)

tailwind-css

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

tailwind-css ×1