Closed bebraw closed 9 years ago
Hi @bebraw, my original idea is not add any css file dependency. In this moment i'm thinking in an approach more encapsulated, something like this https://speakerdeck.com/vjeux/react-css-in-js.
What you think about this?
This is something I'm currently struggling with in my React components. It is true that styles could be written inline with React but how about customization? Does this mean you should be able to provide style
property with possibly nested style declarations to the component? How does this fit the workflow of people (I guess many still prefer CSS files)?
For now I've stuck with classes + separate CSS kind of approach. Having a premade template in the dist costs nothing so I see no reason to exclude it.
Maybe the ideal is somewhere in between? So you would have classes set up according to some convention, say Suit CSS and provide style
property. The problem with sticking to some convention like Suit CSS is that everyone seems to use their own. Regardless which convention you pick, it won't be ideal. It's a difficult problem.
By the way, check out JSS. It seems like a natural fit with React and the approach you linked to.
:+1:
It would be possible to consume the library CSS directly through a
require
using Webpack if it was provided with the project. If you unignoredstyles-examples
, then you could dorequire('react-skylight/styles-examples/default.css')
. Maybe it would be even better to pushdefault.css
to project root as that would clean up the require even further.