{"name":"postcss-modules-scope","version":"3.0.0-rc.1","description":"A CSS Modules transform to extract export statements from local-scope classes","main":"src/index.js","engines":{"node":">= 10.13.0 || >= 12.13.0 || >= 14"},"scripts":{"prettier":"prettier -l --ignore-path .gitignore . \"!test/test-cases\"","eslint":"eslint --ignore-path .gitignore .","lint":"yarn eslint && yarn prettier","test:only":"jest","test:watch":"jest --watch","test:coverage":"jest --coverage --collectCoverageFrom=\"src/**/*\"","pretest":"yarn lint","test":"yarn test:coverage","prepublishOnly":"yarn 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","dependencies":{"postcss-selector-parser":"^6.0.3"},"devDependencies":{"coveralls":"^3.1.0","eslint":"^7.9.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","postcss":"^8.0.7","prettier":"^2.1.2"},"peerDependencies":{"postcss":"^8.0.0"},"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","readmeFilename":"README.md","gitHead":"3f4272c5d1f92a1fbaf51670f7e379a08d2cf00d","_id":"postcss-modules-scope@3.0.0-rc.1","_nodeVersion":"10.15.2","_npmVersion":"6.14.8","dist":{"integrity":"sha512-FZT4qeQbjT+Ojq586hw5SNP4OwI3xI5GzpWC4nfMxdpaIIad0vB2n2VYz05idKyOVzYaK62+qH3K4dacsgbyFA==","shasum":"e527301aa4b34d2e9422928c8b8a45e902b42a61","tarball":"http://registry-npm.ywwl.com/postcss-modules-scope/download/postcss-modules-scope-3.0.0-rc.1.tgz","fileCount":5,"unpackedSize":14264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfafWpCRA9TVsSAnZWagAAS98P/iTczR5ZFM8Ai+1AcBfY\nkx5izZ6hs08U2l+OKrSxQGzZcZn2uCFnuIzac2dFjo8gQ+JxiBTFP7mcSVNw\n811h6Kwu8Ggi7gDPZpCF8vdQHK8UuDEZiOvmqC8xReaC/ZjuQF+WKmeCsMQX\nJmjkHT4Pk/SsLuSFyHdu3mv2x4FInxFyb0S0QrCOhbH+iTeH+c+1kx8vYELF\nzPkf/CSDyCveDvJcEH4M2qSoNKfGTuCLZhpU529nQr+7W7ovhLuKDItKussI\nf7hQkpgBsgRb6zGrfgwsndXiJm6CIYULW5LCXmzGxqP1igWvz3MjNQmJ3FR4\nEaGewB7bO5AojV4F5ZaHS5gw35bx6B28hO1uPSVwq8w6z6gFr55Wus6YItxK\n3JsctNS5BGvANFZQoo2VmiAeAIEQreP6sUMGMUbvNEfzsdRU2Lol0b3Apq+n\nJlUc6W/Kmi6T/wZb25EvCqzI2KuDfVanIxymvGpKLZOQuaZnKSA3ZDsriOm4\nS5q2J89jGVNDHHWqDz3XMLZcun6/7tdwdi3BKmT1b81IDxgehAu+1fejaEga\ngf/fmpsXMe3C64OtY4D9Ot0wDaYiCF7me/QTkl4DUUr7hOKkAvFFs3tuTSRR\nC7+PAFPQ0pZ8F/9DWcamEaOglfrznYHBoYLQGuthAYFY9HXznypdqhjQeusW\nqqnw\r\n=5yaR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEmuXt1XrD9HYsCHVIvPss5qyzibZyMhznfFT60KJOg/AiEAw2XZeZwelPeGv68bAS9TVZgzdmLoFYBAYpI8yGMf9sE="}],"size":4933,"noattachment":false,"key":"/postcss-modules-scope/-/postcss-modules-scope-3.0.0-rc.1.tgz"},"maintainers":[{"name":"markdalgleish","email":"mark.john.dalgleish@gmail.com"},{"name":"sokra","email":"tobias.koppers@googlemail.com"},{"name":"geelen","email":"glen@glenmaddern.com"},{"name":"evilebottnawi","email":"sheo13666q@gmail.com"}],"_npmUser":{"name":"evilebottnawi","email":"sheo13666q@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postcss-modules-scope_3.0.0-rc.1_1600779686521_0.5435022029859176"},"_hasShrinkwrap":false,"publish_time":1600779686629,"_cnpm_publish_time":1600779686629,"dist-tags":{"beta":"1.0.0-beta1","latest":"3.2.1","next":"3.0.0-rc.2"}}