{"name":"jss-extend","description":"Inheritance plugin for jss","version":"0.1.0","author":{"name":"Oleg Slobodskoi","email":"oleg008@gmail.com"},"repository":{"type":"git","url":"git@github.com:jsstyles/jss-extend.git"},"keywords":["jss","plugin","extend","inheritance"],"engines":{},"scripts":{},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"devDependencies":{"qunitjs":"1.15.0","xpkg":"0.2.0","jss":"0.x"},"peerDependencies":{"jss":"0.x"},"gitHead":"54c551ddda9ab5376f8595bce40b2250967337a1","bugs":{"url":"https://github.com/jsstyles/jss-extend/issues"},"homepage":"https://github.com/jsstyles/jss-extend","_id":"jss-extend@0.1.0","_shasum":"ea7a273ee117bb3a4dc4dc665c4d90064ad8a72f","_from":".","_npmVersion":"2.1.3","_nodeVersion":"0.11.12","_npmUser":{"name":"kof","email":"oleg008@gmail.com"},"maintainers":[{"name":"kof","email":"oleg008@gmail.com"}],"dist":{"shasum":"ea7a273ee117bb3a4dc4dc665c4d90064ad8a72f","tarball":"http://registry-npm.ywwl.com/jss-extend/download/jss-extend-0.1.0.tgz","integrity":"sha512-yzGibcGp392m7ny655Wo3mcYEDvg733qhs5r49BEOZo9VjlTA5B7RECaS4bqXJNXJw1ahp7G/pogx7xtJCnyrg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFu7JyuK7xEUZOfrJmznYEPEeSPi4jJLh/cR7W2+0kn2AiEA28cUSDo17rSL37Qm54RJ3R7dpR0gfVzMYLsDSYAVKZA="}],"size":3538,"noattachment":false,"key":"/jss-extend/-/jss-extend-0.1.0.tgz"},"directories":{},"readme":"# JSS plugin that enables mixing in styles\n\n[![Gitter](https://badges.gitter.im/JoinChat.svg)](https://gitter.im/cssinjs/lobby)\n\nThis plugin implements a custom property `extend` which allows you to mix in styles in various ways.\n\nStyle object own properties always take precedence over extended objects, so you can always override the extended definition. Exception is function values.\n\n## Use style object reference\n```javascript\n\nconst buttonColor = {\n  color: 'green'\n}\nconst buttonTheme = {\n  extend: buttonColor\n  background: 'red'\n}\nconst styles = {\n  button: {\n    extend: buttonTheme,\n    fontSize: '20px'\n  }\n}\n```\n\n## Use rule name from the current styles object\n\n```javascript\nconst styles = {\n  buttonColor: {\n    background: 'red'\n  },\n  button: {\n    extend: 'buttonColor',\n    fontSize: '20px'\n  }\n}\n```\n\n## Use array of style objects\n\n```javascript\nconst styles = {\n  button: {\n    extend: [{background: 'red'}, {color: 'green'}],\n    fontSize: '20px'\n  }\n}\n```\n\n```javascript\n\nconst background = {background: 'red'}\nconst color = {color: 'green'}\n\nconst styles = {\n  button: {\n    extend: [background, color],\n    fontSize: '20px'\n  }\n}\n```\n\n## Use function which returns a style object\n\nNested `extend` inside of the function is not supported. Will override other properties defined in the same rule.\n\n```javascript\nconst styles = {\n  button: {\n    extend: (data) => ({\n      color: data.theme.color\n    }),\n    fontSize: '20px'\n  }\n}\n```\n\n## Demo\n\n[Simple demo](http://cssinjs.github.io/examples/plugins/jss-extend/simple/)\n\n[Multi objects demo](http://cssinjs.github.io/examples/plugins/jss-extend/multi/)\n\n## Issues\n\nFile a bug against [cssinjs/jss prefixed with \\[jss-extend\\]](https://github.com/cssinjs/jss/issues/new?title=[jss-extend]%20).\n\n## Run tests\n\n```bash\nnpm i\nnpm run test\n```\n\n## License\n\nMIT\n","publish_time":1417182251293,"_cnpm_publish_time":1417182251293,"dist-tags":{"latest":"6.2.0"}}