Comparison of CSS in JavaScript Libraries for React(github.com)
github.com
Comparison of CSS in JavaScript Libraries for React
https://github.com/FormidableLabs/radium/blob/master/docs/comparison/README.md
5 comments
Or just use webpack? Not sure what these things are trying to solve that making a less or scss file for every component file and require-ing it doesn't.
There are a few arguments here on keeping your CSS in JS just as JSX allows for HTML in JS: https://speakerdeck.com/vjeux/react-css-in-js
Here's another talk that illustrates some of the emerging thoughts around inline styles in React https://www.youtube.com/watch?v=ERB1TJBn32c
Great thing is this does away with the need for these macro languages like less and scss.
If you're interested in CSS in JS you should check out css-modules [1] and its Webpack [2] or Browserify implementation [3].
You get scoped, modular, composable, requirable CSS without the burden of doing styles in JS.
[1] https://github.com/css-modules/css-modules
[2] https://github.com/webpack/css-loader
[3] https://github.com/css-modules/css-modulesify
You get scoped, modular, composable, requirable CSS without the burden of doing styles in JS.
[1] https://github.com/css-modules/css-modules
[2] https://github.com/webpack/css-loader
[3] https://github.com/css-modules/css-modulesify
This is miles better than everything on that list for things that don't need much dynamic style computation.
Here's another great comparison:
https://github.com/MicheleBertoli/css-in-js
I think that css-modules (implemented in webpack's css-loader) is the sanest approach: https://medium.com/seek-ui-engineering/the-end-of-global-css...
I think that css-modules (implemented in webpack's css-loader) is the sanest approach: https://medium.com/seek-ui-engineering/the-end-of-global-css...
So I'm looking for a simple solution 1 step beyond just using js style objects. Would radium be good without creating a ton of lock-in? I can't really sort through this giant chart.
var globalStyles = require("globalStyles");
var styles = { color: globalStyles.blue, padding: foo ? "15px" : "10px", margin: bar(this.state.qux) }
We built Radium to solve the problems this causes, like :hover - it's the lib Chan talks about in that React Europe talk christopherscot links to.
http://projects.formidablelabs.com/radium/
I talked at CSSConf about ditching CSS for inline about a month ago:
https://www.youtube.com/watch?v=NoaxsCi13yQ