如何解决在样式化组件中使用 ClassName 覆盖类
如何在没有 !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"
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。