【发布时间】:2020-06-27 07:00:57
【问题描述】:
我想在本地为组件覆盖外部模块cssclass
In my code
import `style` from './style.module.css' // this is local css module
import `ExternalComponent` from 'ExternalComponent' // suppose this is external module i'm using
function Component(){
return(
<ExternalComponent/>
)
}
现在ExternalComponent 渲染一个div 元素,其类为parent。所以如果我要导入
ExternalComponent 如何在本地导入的style 模块中覆盖ExternalComponent 的parent 类,以便ExternalComponent 中的样式仅针对此组件更改
只有,否则我使用它的地方不会改变。
顺便说一句,我正在使用 react。
【问题讨论】:
标签: css reactjs css-modules react-css-modules babel-plugin-react-css-modules