{"name":"jss-nested","description":"JSS plugin that enables support for nested selectors","version":"2.4.0","author":{"name":"Oleg Slobodskoi","email":"oleg008@gmail.com"},"repository":{"type":"git","url":"git+ssh://git@github.com/cssinjs/jss-nested.git"},"keywords":["cssinnjs","css-in-js","css in js","jss","plugin","nested","nesting"],"scripts":{"all":"npm run lint && npm run test && npm run build","build":"npm run clean && npm run build:lib && npm run build:max && npm run build:min","clean":"rimraf ./lib/*","build:lib":"babel src --out-dir lib","build:max":"NODE_ENV=development webpack src/index.js dist/jss-nested.js","build:min":"NODE_ENV=production webpack src/index.js dist/jss-nested.min.js","lint":"eslint ./src","lint:staged":"lint-staged","test":"karma start --single-run ","test:watch":"karma start","prepublish":"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-preset-es2015":"^6.9.0","babel-preset-stage-0":"^6.5.0","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","jss":"^5.5.0","jss-extend":"^2.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":"^5.5.0"},"lint-staged":{"*.js":["eslint --fix","git add"]},"pre-commit":"lint:staged","gitHead":"a2093aeb7c36fd5becd01ed066df7f3428c8541b","bugs":{"url":"https://github.com/cssinjs/jss-nested/issues"},"homepage":"https://github.com/cssinjs/jss-nested#readme","_id":"jss-nested@2.4.0","_shasum":"d5759543e529e2d2c5ab43ea7d9d3bf980675b42","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.7.1","_npmUser":{"name":"kof","email":"oleg008@gmail.com"},"dist":{"shasum":"d5759543e529e2d2c5ab43ea7d9d3bf980675b42","tarball":"http://registry-npm.ywwl.com/jss-nested/download/jss-nested-2.4.0.tgz","integrity":"sha512-L8486P3uvFBww3haw6Nxz3eYHFYBQgVj17zH7sCHUPGQ+HVJmb0XEXuETdAOMIqGsvjS5g7pFPGDpCf3Qmhldw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFcsbgmRMgj4fhWQeB2E6C6ajlpPvUIv6HRtzN+5v8aMAiAuFXXprv1HI0UJm9k2rKIthXCNOdeDNRUPjSMVYgLDAA=="}],"size":8475,"noattachment":false,"key":"/jss-nested/-/jss-nested-2.4.0.tgz"},"maintainers":[{"name":"kof","email":"oleg008@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/jss-nested-2.4.0.tgz_1473719110414_0.8945819716900587"},"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":1473719112505,"_cnpm_publish_time":1473719112505,"dist-tags":{"latest":"6.0.1"}}