【发布时间】:2019-03-06 17:02:02
【问题描述】:
我正在使用 CSS 模块,到目前为止一切都很好。
我们开始使用外部 UI 库和我们自己的 UI 库,所以我正在编写这样的组件:
<div className={styles['my-component']}>
<ExternalUIComponent />
</div>
假设ExternalUIComponent 有自己的类,在最终的CSS 文件中看起来像这样external-ui-component,我怎样才能从我的css 文件中调整这个组件样式?下面的例子不起作用:
.my-component {
font-size: 1em;
}
.my-component .external-ui-component {
padding: 16px;
// Some other styling adjustments here
}
【问题讨论】:
标签: css reactjs css-modules