react-css

0.0.2 • Public • Published

react-css

Converts plain CSS into (optionally auto-prefixed) React-style properties map.

Usage

/** @jsx React.DOM */
var React = require("react");
var fromCSS = require("react-css").fromCSS;
 
/* Pre-compute the CSS to avoid lengthy calculations at each render cycle */
var myComponentStyle = fromCSS("{ opacity: 0.5; }");
 
var MyComponent = React.createClass({
    render: function() {
        return (
            <div style={myComponentStyle}>
                /* ... */
            </div>
        );
    },
});
/* ... */

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.2
    2,749
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.2
    2,749
  • 0.0.1
    4

Package Sidebar

Install

npm i react-css

Weekly Downloads

1,850

Version

0.0.2

License

MIT

Last publish

Collaborators

  • elie.rotenberg