Do you have a stylesheet per component or a single stylesheet? What are the pros and cons of componentization of stylesheets?
I'm using less design styles based on semantic-ui. Also I use a Radium. I know this is confused way. So there are some rule for our ways.
Radium is used only react front developers.
My team has been using Radium to style components we are building for an internal component library.
Pros:
Cons:
Update: We've been able to get media queries working properly across all of our projects, and its made mobile styling much easier.
It depends.
While css-modules works fine for private projects, it does not fit good for open source projects. The reason it's because if you use css-modules then you are forcing your library user to set up some extra config.
For open source libraries, I think it's better to use inline styles, because on that way the end user just have to include and use your component. I recommend radium to achieve this.
Also use css-modules, be aware that this will change the class names of the html thats rendered which may impact functional testing using selenium and css selectors by classname.
After agonising with straight CSS and then various component implementations, I settled on simply using css-modules and compiling them through webpack's css-loader. There's just far less friction doing it this way.
Kevin Wolf
Full Stack Developer
Alex
alphanumeric
A neat way to go is to work with a library, I've been trying out material-ui.com on a project and really like it, then I just override with inline CSS anytime I need to, which, frankly, is infrequently. Each component only requires the styles it needs so it retains modularity and does a lot of work for you. getessence.io is also a nice one, with a bit more of a learning curve, I thought.