**关闭。**此题需要debugging details。目前不接受答复。
编辑问题以包括desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem。这将帮助其他人回答这个问题。
3天前关闭。
Improve this question
我试图改变背景悬停的一个按钮,我正在创建,但它不工作。我使用tailwind、next.js和react来创建我的应用程序。
奇怪的是,我的代码在我同事的电脑上工作,但在我的电脑上却不行。有人能帮帮我吗
代码链接如下:https://codesandbox.io/s/icy-leftpad-c3wqwl?file=/src/ViewButton.js我的组件是ViewButton.js
tailwind配置文件:
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./pages/**/*.{js,ts,jsx,tsx,mdx}",
"./components/**/*.{js,ts,jsx,tsx,mdx}",
"./app/**/*.{js,ts,jsx,tsx,mdx}",
"./stories/**/*.{js,ts,jsx,tsx}", // Here!
],
theme: {
extend: {
colors: {
linearPurple: {
200: "#313147",
300: "#21232e",
400: "#272a39",
600: "#191a23",
},
},
textColor: {
skin: {
base: "rgb(var( --color-text-base)/ <alpha-value>)",
},
},
ringWidth: ["focus-visible"],
ringColor: ["focus-visible"],
ringOpacity: ["focus-visible"],
ringOffsetWidth: ["focus-visible"],
ringOffsetColor: ["focus-visible"],
backgroundColor: {
skin: {
fill: "rgb(var( --color-background)/ <alpha-value>)",
fillHome: "rgb(var( --color-home-background)/ <alpha-value>)",
},
},
},
},
variants: {},
plugins: [],
};
1条答案
按热度按时间uinbv5nw1#
假设这是关于
ViewButton.js
中的类的style.viewButton
字符串,那么在hover:
和bg-red-200
之间不应该有空格。因此,将hover: bg-red-200
替换为hover:bg-red-200
。