【发布时间】:2022-03-31 21:56:18
【问题描述】:
我在 Chakra UI's extendTheme function 中设置我的输入样式,但是我正在努力设置自动完成的输入样式。使用 :autofill 伪选择器似乎没有任何意义,因为浏览器 (Chrome) 使用 !important 设置了自己的样式,这会强制输入的背景颜色为白色。
const theme = extendTheme({
components: {
Input: {
baseStyle: {
field: {
bg: "gray.700",
color: "gray.300",
_hover: {
bg: "gray.500",
},
_focus: {
bg: "gray.500",
},
// This does not work
_autofill: {
bg: "gray.500",
}
}
}
}
}
})
【问题讨论】:
标签: css google-chrome emotion chakra-ui