{"name":"jss-nested","description":"JSS plugin that enables support for nested selectors","version":"5.0.0","author":{"name":"Oleg Slobodskoi","email":"oleg008@gmail.com"},"repository":{"type":"git","url":"git+ssh://git@github.com/cssinjs/jss-nested.git"},"keywords":["cssinjs","css-in-js","css in js","jss","plugin","nested","nesting"],"scripts":{"all":"npm run lint && npm run test && npm run build","bench":"cross-env BENCHMARK=true npm run test","build":"npm run clean && npm run build:lib && npm run build:tests && npm run build:dist","build:lib":"babel src --out-dir lib","build:tests":"npm run build:tests:lib && npm run build:tests:local","build:tests:lib":"cross-env NODE_ENV=test babel src --out-dir tests","build:tests:local":"cross-env NODE_ENV=test webpack src/index.test.js tmp/tests.js","build:dist":"npm run build:dist:max && npm run build:dist:min","build:dist:max":"cross-env NODE_ENV=development webpack src/index.js dist/jss-nested.js","build:dist:min":"cross-env NODE_ENV=production webpack src/index.js dist/jss-nested.min.js","clean":"rimraf '{lib,dist,tests,tmp}/*'","lint":"eslint ./src ./benchmark","lint:staged":"lint-staged","test":"cross-env NODE_ENV=test karma start --single-run ","test:watch":"cross-env NODE_ENV=test karma start","prepublishOnly":"npm run all"},"license":"MIT","main":"./lib/index.js","devDependencies":{"babel-cli":"^6.5.1","babel-core":"^6.5.1","babel-eslint":"^6.1.2","babel-loader":"^6.2.4","babel-plugin-rewire":"^1.0.0","babel-preset-es2015":"^6.9.0","babel-preset-stage-0":"^6.5.0","common-tags":"^1.4.0","cross-env":"^3.1.3","eslint":"^2.8.0","eslint-config-airbnb":"^8.0.0","eslint-config-jss":"^1.1.0","eslint-plugin-import":"^1.12.0","eslint-plugin-jsx-a11y":"^1.5.5","eslint-plugin-react":"^5.0.1","expect.js":"^0.3.1","json-loader":"^0.5.4","jss":"^8.0.0","jss-extend":"^5.0.0","karma":"^1.1.1","karma-benchmark":"^0.6.0","karma-benchmark-reporter":"^0.1.1","karma-browserstack-launcher":"^1.0.0","karma-chrome-launcher":"^1.0.1","karma-coverage":"^1.1.0","karma-firefox-launcher":"^1.0.0","karma-mocha":"^1.0.1","karma-mocha-reporter":"^2.0.2","karma-safari-launcher":"^1.0.0","karma-sourcemap-loader":"^0.3.5","karma-webpack":"^1.7.0","lint-staged":"^3.0.1","lodash.assign":"^4.0.9","mocha":"^3.0.2","pre-commit":"^1.1.3","rimraf":"^2.5.4","webpack":"^1.12.2"},"peerDependencies":{"jss":"^8.0.0"},"lint-staged":{"./src/*.js":["eslint","git add"]},"pre-commit":"lint:staged","dependencies":{"warning":"^3.0.0"},"gitHead":"e30d06d764f88497216fd5f0a8108c0460d64508","bugs":{"url":"https://github.com/cssinjs/jss-nested/issues"},"homepage":"https://github.com/cssinjs/jss-nested#readme","_id":"jss-nested@5.0.0","_npmVersion":"5.0.3","_nodeVersion":"6.10.2","_npmUser":{"name":"kof","email":"oleg008@gmail.com"},"dist":{"integrity":"sha512-9Molau+XVpSc6QEco3EC5yXmzeGMc5ZVII8+qy6jD6bvu6Y9mpfGoJ00LalR/n7xr/LC7Cxgs44UQQlLzumMBg==","shasum":"c0752f31f2d465110d7de6ac83583dbed669faa0","tarball":"http://registry-npm.ywwl.com/jss-nested/download/jss-nested-5.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAt1daDG0VuywGNY8Y9bIYR9Li/9h0+v37BYVUgTcHO2AiEAgRK9cEzdNLRuM1k24Pc71t+0eidN/EiLOSP2jgJPD0I="}],"size":36706,"noattachment":false,"key":"/jss-nested/-/jss-nested-5.0.0.tgz"},"maintainers":[{"name":"kof","email":"oleg008@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jss-nested-5.0.0.tgz_1497992565393_0.8266997886821628"},"directories":{},"readme":"# JSS plugin enables support for nested rules\n\n[![Gitter](https://badges.gitter.im/JoinChat.svg)](https://gitter.im/cssinjs/lobby)\n\nMake sure you read [how to use\nplugins](https://github.com/cssinjs/jss/blob/master/docs/setup.md#setup-with-plugins)\nin general.\n\n\n## Use `&` to reference selector of the parent rule.\n\n```javascript\nconst styles = {\n  container: {\n    padding: 20,\n    '&:hover': {\n      background: 'blue'\n    },\n    // Add a global .clear class to the container.\n    '&.clear': {\n      clear: 'both'\n    },\n    // Reference a global .button scoped to the container.\n    '& .button': {\n      background: 'red'\n    },\n    // Use multiple container refs in one selector\n    '&.selected, &.active': {\n      border: '1px solid red'\n    }\n  }\n}\n```\n\nCompiles to:\n\n```css\n.container-3775999496 {\n  padding: 20px;\n}\n.container-3775999496:hover {\n  background: blue;\n}\n.container-3775999496.clear {\n  clear: both;\n}\n.container-3775999496 .button {\n  background: red;\n}\n.container-3775999496.selected, .container-3775999496.active {\n  border: 1px solid red;\n}\n```\n\n## Use `$ruleName` to reference a local rule within the same style sheet.\n\n```javascript\nconst styles = {\n  container: {\n    // Reference the local rule \"button\".\n    '& $button': {\n      padding: '10px'\n    },\n    // Multiple local refs in one rule.\n    '&:hover $button, &:active $button': {\n      color: 'red',\n    },\n    '&:focus $button': {\n      color: 'blue'\n    }\n  },\n  button: {\n    color: 'grey'\n  }\n}\n```\n\nCompiles to:\n\n```css\n.button-3940538223 {\n  color: grey;\n}\n.container-2645419599 .button-3940538223 {\n  padding: 10px;\n}\n.container-2645419599:hover .button-3940538223, .container-2645419599:active .button-3940538223 {\n  color: red;\n}\n.container-2645419599:focus .button-3940538223 {\n  color: blue;\n}\n```\n\n## Use at-rules inside of regular rules.\n\n```javascript\nconst styles = {\n  button: {\n    color: 'red',\n    '@media (min-width: 1024px)': {\n      width: 200\n    }\n  }\n}\n```\n\nCompiles to:\n\n```css\n.button-2683044438 {\n  color: red;\n}\n@media (min-width: 1024px) {\n  .button-2683044438 {\n    width: 200px;\n  }\n}\n```\n\n## Deep nesting\n\n```javascript\nconst styles = {\n  button: {\n    '&$warn': {\n      color: 'red',\n      '&:hover, &:focus': {\n        color: 'white',\n        background: 'red'\n      }\n    }\n  },\n  warn: {}\n}\n```\n\nCompiles to:\n\n```css\n.button-274964227.warn-2315792072 {\n  color: red;\n}\n.button-274964227.warn-2315792072:hover, .button-274964227.warn-2315792072:focus {\n  color: white;\n  background: red;\n}\n```\n\n## Demo\n\n[Simple](http://cssinjs.github.io/examples/plugins/jss-nested/simple/index.html)\n\n## Issues\n\nFile a bug against [cssinjs/jss prefixed with \\[jss-nested\\]](https://github.com/cssinjs/jss/issues/new?title=[jss-nested]%20).\n\n## Run tests\n\n```bash\nnpm i\nnpm run test\n```\n\n## License\n\nMIT\n","publish_time":1497992566429,"_cnpm_publish_time":1497992566429,"dist-tags":{"latest":"6.0.1"}}