{"name":"postcss-modules-scope","version":"1.0.2","description":"A CSS Modules transform to extract export statements from local-scope classes","main":"lib/index.js","scripts":{"lint":"eslint src","build":"babel --out-dir lib src","watch":"chokidar src -c 'npm run build'","test":"mocha --compilers js:babel/register","posttest":"npm run lint && npm run build","autotest":"chokidar src test -c 'npm test'","precover":"npm run lint && npm run build","cover":"babel-istanbul cover node_modules/.bin/_mocha","travis":"npm run cover -- --report lcovonly","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/geelen/postcss-modules-scope.git"},"keywords":["css-modules","postcss","plugin"],"files":["lib"],"author":{"name":"Glen Maddern"},"license":"ISC","bugs":{"url":"https://github.com/geelen/postcss-modules-scope/issues"},"homepage":"https://github.com/geelen/postcss-modules-scope","dependencies":{"css-selector-tokenizer":"^0.6.0","postcss":"^5.0.4"},"devDependencies":{"babel":"^5.4.7","babel-eslint":"^4.1.3","babel-istanbul":"^0.4.0","babelify":"^6.1.2","chokidar-cli":"^1.0.1","codecov.io":"^0.1.2","coveralls":"^2.11.2","css-selector-parser":"^1.0.4","eslint":"^1.5.0","mocha":"^2.2.5"},"gitHead":"583db89803dc5153acfa5cd64003e163837cc57d","_id":"postcss-modules-scope@1.0.2","_shasum":"ff977395e5e06202d7362290b88b1e8cd049de29","_from":".","_npmVersion":"3.10.5","_nodeVersion":"5.3.0","_npmUser":{"name":"geelen","email":"hi@glenmaddern.com"},"dist":{"shasum":"ff977395e5e06202d7362290b88b1e8cd049de29","tarball":"http://registry-npm.ywwl.com/postcss-modules-scope/download/postcss-modules-scope-1.0.2.tgz","integrity":"sha512-Tky52I66SGOq/IMnhaqfgPUfrBv4pxTFtoLAwsHhznYllsFCnU2ChnUTaeLXIp1rD4jUkjUDjP1e0cNERsERQQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICrK91rIE4OkH2qmyNhL2zAT7+XzP/6ZmBYei7/hBsf8AiBmrmU8ZNZBx3tQArWj66VnuCpNLPpM8q3/v102gQrt5w=="}],"size":3375,"noattachment":false,"key":"/postcss-modules-scope/-/postcss-modules-scope-1.0.2.tgz"},"maintainers":[{"name":"geelen","email":"hi@glenmaddern.com"},{"name":"markdalgleish","email":"mark.john.dalgleish@gmail.com"},{"name":"sokra","email":"tobias.koppers@googlemail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/postcss-modules-scope-1.0.2.tgz_1469010331971_0.23442491912283003"},"directories":{},"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":1469010334450,"_cnpm_publish_time":1469010334450,"dist-tags":{"beta":"1.0.0-beta1","latest":"3.2.1","next":"3.0.0-rc.2"}}