看了一篇文章 https://medium.com/@rofrischmann/react-component-styling-without-limitations-84e5e776fd44
对于css的组织,我现在的项目是在代码中引入,使用webpack打包的。从一个组件的角度来看,我都是暴露一个class,然后用css做任意的实现。但有时写内联样式似乎会更好,比如说像一个滚动条组件:
<div className={this.props.className} style={position: relative; overflow:hidden}>
{this.props.chilren}
<div className="scrollbar"></div>
</div>
因为我总是希望它拥有 position: relative; overflow:hidden;
这个样式。
不知道大家在项目中是如何组织组件的样式的,另外我在顶上贴的文章中似乎搞的很复杂,大家怎么看?