在样式化组件中使用 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"
}

Dev. Console apperance

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)