I'm a big react fan. It's a really awesome tool for building UI but there are some problems which are difficult to get rid of without trouble.
One of them is styling components, the original 'react-way' is using inline styles, but this solution has some negative qualities, ex:
But there are some positive ones:
Other "WriteYourStylesInJS" practices have the same weaknesses, and the biggest is the reduced set of styling tools (Yes, I'm too lazy to write prefixes).
As for my actual question, how do you make your react components and css (or scss/sass or less or any other language) styles cohesive?
How do you make styles customizable and maintainable?
Is my prepossesion against inline styles reasonable?
In my project, i have used separated css files for styling, with same name like my components. In production it will be anyway minified and splitted in one js/css file, but you can easily copy/paste your components from project to project.
I'm using inline styles and I had some problems at the beginning but you know what? I love it know...
But you're right and you can have headaches with pseudo selectors like :hover... or vendor prexing, even media queries.
So.. if you need all of that, maybe you should check Radium
©2020 All rights reserved.