Utility to manage styles for React JS components
Switch branches/tags
Nothing to show
Clone or download
hedgerwang
Latest commit 55f00f9 Sep 29, 2013
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src use '®' to namespace selector Sep 28, 2013
README.md Make className accessible directly from rules. Sep 17, 2013
package.json use '®' to namespace selector Sep 28, 2013

README.md

React Styles

Utility to manage styles.

Code Example
var React = require('React');
var ReactStyle = require('ReactStyle');

// Require pre-defined style rules.
var ExampleStyleRules = require('ExampleStyleRules');

// Define your own style rules.
var AnotherStyleRules = ReactStyle.create({
  '.body': {
    borderWidth: '10px'
  },

  '.body > .header': {
    fontSize: '10px',
    fontWeight: 'bold'
  }
});

// Add style rules to site.
ReactStyle.addRules(ExampleStyleRules);
ReactStyle.addRules(AnotherStyleRules);

var Example = React.createClass({
  render: function() {
    return (
      <html>
        <head>
          <title>React Styles Example</title>
          {ReactStyle.renderToComponents()}
        </head>
        <body class={ExampleStyleRules.body + ' ' + AnotherStyleRules.body}>
          <h1 class={AnotherStyleRules.header}>
            Hello World
          </div>
        </body>
      </html>
    );
  }
});

module.exports = Example;