{"name":"rcss","version":"0.1.2","description":"Turn your JavaScript objects into CSS classes.","main":"index.js","directories":{"example":"examples"},"dependencies":{"lodash.escape":"^2.4.1","lodash.merge":"^2.4.1","valid-css-props":"0.0.2","valid-media-queries":"0.0.2"},"devDependencies":{"jest-cli":"^0.1.15"},"scripts":{"test":"jest"},"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"},"jest":{"unmockedModulePathPatterns":["./node_modules/*"]},"gitHead":"c816ee286e5f6ca47e936aebc4dcafbf74ecda40","homepage":"https://github.com/chenglou/RCSS","_id":"rcss@0.1.2","_shasum":"b4416a98a7245f2ebe5bf75c8441d2f6986e512d","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"chenglou","email":"chenglou92@gmail.com"},"maintainers":[{"name":"chenglou","email":"chenglou92@gmail.com"}],"dist":{"shasum":"b4416a98a7245f2ebe5bf75c8441d2f6986e512d","tarball":"http://registry-npm.ywwl.com/rcss/download/rcss-0.1.2.tgz","integrity":"sha512-iY/7WOJD7Rm4eETKygbM/S1872BNRAsaAet35C4QsH9pzi0Oj3z2VxDu4kyLGK6IpzhANThl/aYK1CBa2tseJw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBr3ivNW36ayPeHJVTs8u2Rs3ncY9B1LSgkAo7CbqGt5AiEA7/VkCC0tQ29clt/l+ExpWTHDn3i1QK0bMU4ff7TzTBw="}],"size":5014,"noattachment":false,"key":"/rcss/-/rcss-0.1.2.tgz"},"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":1406762472543,"_cnpm_publish_time":1406762472543,"dist-tags":{"latest":"0.1.5"}}