如何在没有 !important 和 内联样式 的样式组件中使用 className 属性覆盖 css 类(css 类是从样式组件随机命名的)。 React 版本为:“16.12.0”,样式组件版本为“5.2.1”
const Button = styled.button`
${props => props.theme.button.style}
`
<Button
css={theme => theme.button.style}
className={"bertug"}
>
</Button>
我的主题风格是;
const theme = {
button: {
style: {
color: "#fff"
}
}
}
我的课;
.bertug {
color: "#000"
}