{"name":"postcss-modules-scope","version":"2.1.0","description":"A CSS Modules transform to extract export statements from local-scope classes","main":"src/index.js","engines":{"node":">= 6"},"scripts":{"lint":"eslint src test","pretest":"yarn lint","test":"mocha","autotest":"chokidar src test -c 'yarn test'","precover":"yarn lint","cover":"nyc mocha","travis":"yarn cover","prepublish":"yarn run test"},"repository":{"type":"git","url":"git+https://github.com/css-modules/postcss-modules-scope.git"},"keywords":["css-modules","postcss","plugin"],"author":{"name":"Glen Maddern"},"license":"ISC","bugs":{"url":"https://github.com/css-modules/postcss-modules-scope/issues"},"homepage":"https://github.com/css-modules/postcss-modules-scope","prettier":{"semi":true,"singleQuote":true,"trailingComma":"es5"},"dependencies":{"postcss":"^7.0.6","postcss-selector-parser":"^6.0.0"},"devDependencies":{"chokidar-cli":"^1.0.1","codecov.io":"^0.1.2","coveralls":"^3.0.2","eslint":"^5.9.0","mocha":"^6.0.2","nyc":"^13.1.0"},"gitHead":"4fa692e1f0f8db7a58b1057fa60f33687ef2505a","_id":"postcss-modules-scope@2.1.0","_nodeVersion":"10.15.0","_npmVersion":"6.8.0","dist":{"integrity":"sha512-91Rjps0JnmtUB0cujlc8KIKCsJXWjzuxGeT/+Q2i2HXKZ7nBUeF9YQTZZTNvHVoNYj1AthsjnGLtqDUE0Op79A==","shasum":"ad3f5bf7856114f6fcab901b0502e2a2bc39d4eb","tarball":"http://registry-npm.ywwl.com/postcss-modules-scope/download/postcss-modules-scope-2.1.0.tgz","fileCount":5,"unpackedSize":12738,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcflxKCRA9TVsSAnZWagAAaP0QAI8QBCR1pgwqX/j8W+0e\n7L75fIRCABmyODqP7nIb7LKjFD2qyva5ZcTVrEcC00Twjq8yFsKcGxAJIVhi\n0bGZqp7mu82tM1Hxw/9dXSaTKQZfgy+czQcdaXmZDdAFhBNe+impBWSnPyRs\nRbnOIev4t3mzIY0ZvgIv1em1KzcyxraimkgSAvHxMEvY9t5ryT9DSUwOQsmG\nUYjILJ8TnVTib6C845vAWWNLYIPe1awBqBgpsuN5+YPnFds8le+4eECVADcu\nQEY/PVURGDe2s/qM5snb6BSNszRrpdwGt5TuSGRot03PGgY/RnLWRfy571cJ\nEmmjYdFLSajUojB38LiO/2O1XHJs4Ba9QvtI4CPkXAcrLBa5vmxG7G4dcgnc\nEHMICKuviDYRuziXBVcV3DnghFQBmuM8KWet2S9SljIPknm2TLu4qVX2u459\n2UWC1o2CNKMn5RkjUfqIiSHlb0DPKTnT1QAcWOdhW9MuauXkiVOHYdBQd4FE\nuKnJFxMZH8geJpR1BGGVWN0U87YcXc3LKmoy29ZQvqZMK2lZGV2TiHZBqY9l\noAwPvA82oXOpHAIqBkM7fkhBCxD1N6ZBN7R4hSRSvFdfYI/TzufrA5cbN5IA\nGLUMXMziLBPKV8/k6fnq03hOmP0LnQYnRdfR+yHbdjgGZbE14AgyjYqnGDTT\nS7pO\r\n=3d6j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDUWfPkRkvVb2gp2IXiUhy/wa3Gl3fzlAbPK29xJ7HKpQIgJQWHcmumpwPdPnc0waKPkTbWdZmkOUHxC112k8p8AMA="}],"size":4583,"noattachment":false,"key":"/postcss-modules-scope/-/postcss-modules-scope-2.1.0.tgz"},"maintainers":[{"name":"geelen","email":"hi@glenmaddern.com"},{"name":"markdalgleish","email":"mark.john.dalgleish@gmail.com"},{"name":"sokra","email":"tobias.koppers@googlemail.com"}],"_npmUser":{"name":"evilebottnawi","email":"sheo13666q@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postcss-modules-scope_2.1.0_1551785033909_0.3636569290994489"},"_hasShrinkwrap":false,"readme":"# CSS Modules: Scope Locals & Extend\n\n[![Build Status](https://travis-ci.org/css-modules/postcss-modules-scope.svg?branch=master)](https://travis-ci.org/css-modules/postcss-modules-scope)\n\nTransforms:\n\n```css\n:local(.continueButton) {\n  color: green;\n}\n```\n\ninto:\n\n```css\n:export {\n  continueButton: __buttons_continueButton_djd347adcxz9;\n}\n.__buttons_continueButton_djd347adcxz9 {\n  color: green;\n}\n```\n\nso it doesn't pollute CSS global scope and can be simply used in JS like so:\n\n```js\nimport styles from \"./buttons.css\";\nelem.innerHTML = `<button class=\"${styles.continueButton}\">Continue</button>`;\n```\n\n## Composition\n\nSince we're exporting class names, there's no reason to export only one. This can give us some really useful reuse of styles:\n\n```css\n.globalButtonStyle {\n  background: white;\n  border: 1px solid;\n  border-radius: 0.25rem;\n}\n.globalButtonStyle:hover {\n  box-shadow: 0 0 4px -2px;\n}\n:local(.continueButton) {\n  compose-with: globalButtonStyle;\n  color: green;\n}\n```\n\nbecomes:\n\n```\n.globalButtonStyle {\n  background: white;\n  border: 1px solid;\n  border-radius: 0.25rem;\n}\n.globalButtonStyle:hover {\n  box-shadow: 0 0 4px -2px;\n}\n:local(.continueButton) {\n  compose-with: globalButtonStyle;\n  color: green;\n}\n```\n\n**Note:** you can also use `composes` as a shorthand for `compose-with`\n\n## Local-by-default & reuse across files\n\nYou're looking for [CSS Modules](https://github.com/css-modules/css-modules). It uses this plugin as well as a few others, and it's amazing.\n\n## Building\n\n```\nnpm install\nnpm test\n```\n\n- Status: [![Build Status](https://travis-ci.org/css-modules/postcss-modules-scope.svg?branch=master)](https://travis-ci.org/css-modules/postcss-modules-scope)\n- Lines: [![Coverage Status](https://coveralls.io/repos/css-modules/postcss-modules-scope/badge.svg?branch=master)](https://coveralls.io/r/css-modules/postcss-modules-scope?branch=master)\n- Statements: [![codecov.io](http://codecov.io/github/css-modules/postcss-modules-scope/coverage.svg?branch=master)](http://codecov.io/github/css-modules/postcss-modules-scope?branch=master)\n\n## Development\n\n- `npm test:watch` will watch `src` and `test` for changes and run the tests\n\n## License\n\nISC\n\n## With thanks\n\n- Mark Dalgleish\n- Tobias Koppers\n- Guy Bedford\n\n---\n\nGlen Maddern, 2015.\n","publish_time":1551785034065,"_cnpm_publish_time":1551785034065,"dist-tags":{"beta":"1.0.0-beta1","latest":"3.2.1","next":"3.0.0-rc.2"}}