0.2.1 • Published 10 years ago

cssobjectify v0.2.1

Weekly downloads
3
License
-
Repository
github
Last release
10 years ago

cssobjectify

Source transform for browserify or dcompose which converts CSS into JSON objects which can be used further by libraries like React to assign styles to UI components.

styles.css:

MyComponent {
  font-size: 12px;
  background-color: red;
}

myapp.js:

var React = require('react-tools/build/modules/React');
var Styles = require('./styles.css');

var MyComponent = React.createClass({
  render: function() {
    return (
      <div style={Styles.MyComponent}>
        Hello, world!
      </div>
    )
  }
});

Usage

Use npm to install the package:

% npm install cssobjectify

And use it with browserify:

% browserify -t cssobjectify ./myapp.js

where ./myapp.js or its dependencies can reference *.css files by require(...) calls.

0.2.1

10 years ago

0.2.0

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago