{"name":"rcss","version":"0.0.0","description":"CSS as JavaScript objects, imported with `require()`.","main":"index.js","directories":{"example":"examples"},"dependencies":{"sha1":"~1.1.0"},"devDependencies":{},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/chenglou/RCSS.git"},"keywords":["css","preprocessor","json","react","rcss","style"],"author":{"name":"chenglou"},"license":"MIT","bugs":{"url":"https://github.com/chenglou/RCSS/issues"},"_id":"rcss@0.0.0","dist":{"shasum":"125eef5e17a8f68cff0385d56d23054b4d8bc257","tarball":"http://registry-npm.ywwl.com/rcss/download/rcss-0.0.0.tgz","integrity":"sha512-OgPseFDcQCbhhLJiAkzK5m2ohB83uSgsHqImx9dMabZrCRnTAYpoeE97hRFx9pv2hQYL7gN6L6Q+Kv6RcUaMQw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9AmlyHkB1fxltx8bM2e9V7TU63jVy78xp39mjgTr2igIhAL0bqktUyX7F+rCHSJnop8ZPLRHq2IJklusde4H2kSKI"}],"size":1427192,"noattachment":false,"key":"/rcss/-/rcss-0.0.0.tgz"},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"chenglou","email":"chenglou92@gmail.com"},"maintainers":[{"name":"chenglou","email":"chenglou92@gmail.com"}],"readme":"# RCSS\n\nTurn your JavaScript objects into CSS classes.\n\nDesigned with [React](http://facebook.github.io/react/) and [Browserify](http://browserify.org) in mind.\n\n```bash\nnpm install rcss\n```\n\nDemo of the example folder output [here](https://rawgit.com/chenglou/RCSS/master/examples/index.html). No CSS files involved.\n\n## Overview\n\nbutton.js:\n```js\nvar RCSS = require('RCSS');\n\nvar button = {\n  display: 'inline-block',\n  padding: '6px 12px',\n  // CamelCased. Transformed back into the dashed CSS counterparts on-the-fly.\n  marginBottom: '0',\n  ':hover': {\n    color: 'blue'\n  }\n};\n\nmodule.exports = RCSS.registerClass(button);\n```\n\nindex.js\n```html\n/** @jsx React.DOM */\n\nvar React = require('React');\nvar RCSS = require('RCSS');\n\nvar button = require('./button');\n\nRCSS.injectAll();\n\nReact.renderComponent(\n  <button className={button.className}>Hello!</button>,\n  document.body\n);\n```\n\nEasy =).\n\n## API\n\n### RCSS.registerClass(styleObject)\nWrap the style declaration and register it internally. Returns a new object of the format: `{className: 'uniqueClassName', style: originalStyleObj}`. You can then use to the opaque className and the style object however you want.\n\n### RCSS.injectAll()\nA top-level call that parses all the registered style objects into real CSS, puts the result in a style tag, and injects it in the document `head`. This clears the styles registry.\n\n### RCSS.cascade(styleObj1, styleObj2, ...)\nA simple merge utility that returns a new object. Typically used [this way](https://github.com/chenglou/RCSS/blob/master/examples/primaryButton.js#L6).\n\n### RCSS.getStylesString()\nFor server-side rendering, you'd want the big style string instead of calling `injectAll()`. In fact, `injectAll()` is nothing but a helper that takes the output of `getStylesString`, creates a tag and fill the content, and puts it in `head`.\n\n## Motivations\n\n- Client-side asset bundling is complicated. RCSS piggy rides on whatever `require` implementation you use ([Browserify](http://browserify.org), [Webpack](http://webpack.github.io), etc.), so there's no extra compilation step.\n- Use the full power of a programming language with CSS.\n- No CSS preprocessor needed. There is no domain-specific language to learn, since you're constructing your JavaScript objects in... well, JavaScript.\n- CSS namespacing for free.\n- Cascading for free through simple object merges.\n- Validates your CSS properties.\n- ... And more to come. Just imagine what you can do to normal objects.\n\n## License\nMIT.\n","publish_time":1384400034018,"_cnpm_publish_time":1384400034018,"dist-tags":{"latest":"0.1.5"}}