【发布时间】:2021-12-23 13:41:18
【问题描述】:
当我将鼠标悬停在按钮上时,我试图让按钮中的文本颜色发生变化,但它不起作用...... 我的 React 代码是这样的
<button className="px-4 py-2 bg-blue-500 text-light hover:bg-light hover:border-2 hover:border-blue-500 hover:text-blue-500">Sign Up</button>
我的顺风配置文件看起来像这样
const colors = require("tailwindcss/colors");
module.exports = {
purge: [],
darkMode: false, // or 'media' or 'class'
theme: {
extend: {
colors: {
light: "#e2f3f5",
teal: "#22d1ee",
blue: "#3d5af1",
dark: "#0e153a",
},
},
},
variants: {
extend: {
fontSize: ["hover", "focus"],
backgroundOpacity: ["active"],
borderWidth: ["hover", "focus"],
textColor: [
"responsive",
"dark",
"group-hover",
"focus-within",
"hover",
"focus",
],
},
},
plugins: [],
};
然而,文本颜色在悬停时不会改变。有人可以帮帮我吗?
【问题讨论】:
标签: css reactjs hover tailwind-css textcolor