{"_id":"postcss-modules-sync","_rev":"366821","name":"postcss-modules-sync","description":"A PostCSS plugin to use CSS Modules synchronously in js","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"schiehll","email":"rn.schiehll@gmail.com"}],"time":{"modified":"2021-07-19T07:29:38.000Z","created":"2016-10-25T02:53:15.139Z","1.0.0":"2017-01-24T17:42:33.052Z","0.1.0":"2016-10-25T02:53:15.139Z"},"users":{},"author":{"name":"schiehll","email":"rn.schiehll@gmail.com","url":"http://github.com/schiehll"},"repository":{"type":"git","url":"git+https://github.com/schiehll/postcss-modules-sync.git"},"versions":{"1.0.0":{"name":"postcss-modules-sync","version":"1.0.0","description":"A PostCSS plugin to use CSS Modules synchronously in js","main":"lib/index.js","repository":{"type":"git","url":"git+https://github.com/schiehll/postcss-modules-sync.git"},"keywords":["PostCSS","CSS Modules"],"author":{"name":"schiehll","email":"rn.schiehll@gmail.com","url":"http://github.com/schiehll"},"license":"MIT","scripts":{"build":"babel ./src --out-dir ./lib"},"dependencies":{"generic-names":"^1.0.2","icss-replace-symbols":"^1.0.2","postcss":"^5.2.5","postcss-modules-local-by-default":"^1.1.1","postcss-modules-scope":"^1.0.2","string-hash":"^1.1.0"},"devDependencies":{"babel-cli":"^6.18.0","babel-plugin-transform-class-properties":"^6.18.0","babel-preset-es2015":"^6.18.0"},"babel":{"presets":["es2015"],"plugins":["transform-class-properties"]},"gitHead":"90140f15adc9e8271aaac56ce0d9723f793c312c","bugs":{"url":"https://github.com/schiehll/postcss-modules-sync/issues"},"homepage":"https://github.com/schiehll/postcss-modules-sync#readme","_id":"postcss-modules-sync@1.0.0","_shasum":"619a719cf78dd16a4834135140b324cf77334be1","_from":".","_npmVersion":"3.10.10","_nodeVersion":"7.2.1","_npmUser":{"name":"schiehll","email":"rn.schiehll@gmail.com"},"dist":{"shasum":"619a719cf78dd16a4834135140b324cf77334be1","size":2586,"noattachment":false,"key":"/postcss-modules-sync/-/postcss-modules-sync-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/postcss-modules-sync/download/postcss-modules-sync-1.0.0.tgz"},"maintainers":[{"name":"schiehll","email":"rn.schiehll@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/postcss-modules-sync-1.0.0.tgz_1485279752803_0.3112388155423105"},"directories":{},"publish_time":1485279753052,"_cnpm_publish_time":1485279753052,"_hasShrinkwrap":false},"0.1.0":{"name":"postcss-modules-sync","version":"0.1.0","description":"A PostCSS plugin to use CSS Modules synchronously in js","main":"lib/index.js","repository":{"type":"git","url":"git+https://github.com/schiehll/postcss-modules-sync.git"},"keywords":["PostCSS","CSS Modules"],"author":{"name":"schiehll","email":"rn.schiehll@gmail.com","url":"http://github.com/schiehll"},"license":"MIT","scripts":{"build":"babel ./src --out-dir ./lib"},"dependencies":{"icss-replace-symbols":"^1.0.2","postcss":"^5.2.5","postcss-modules-local-by-default":"^1.1.1","postcss-modules-scope":"^1.0.2","string-hash":"^1.1.0"},"devDependencies":{"babel-cli":"^6.18.0","babel-plugin-transform-class-properties":"^6.18.0","babel-preset-es2015":"^6.18.0"},"babel":{"presets":["es2015"],"plugins":["transform-class-properties"]},"gitHead":"f90b300e022496001fdab73b8f917d05370c9032","bugs":{"url":"https://github.com/schiehll/postcss-modules-sync/issues"},"homepage":"https://github.com/schiehll/postcss-modules-sync#readme","_id":"postcss-modules-sync@0.1.0","_shasum":"bec7586147fed4a39a417c13a63798e3f68813be","_from":".","_npmVersion":"3.5.3","_nodeVersion":"6.9.1","_npmUser":{"name":"schiehll","email":"rn.schiehll@gmail.com"},"dist":{"shasum":"bec7586147fed4a39a417c13a63798e3f68813be","size":2435,"noattachment":false,"key":"/postcss-modules-sync/-/postcss-modules-sync-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/postcss-modules-sync/download/postcss-modules-sync-0.1.0.tgz"},"maintainers":[{"name":"schiehll","email":"rn.schiehll@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/postcss-modules-sync-0.1.0.tgz_1477363994898_0.9219330798368901"},"directories":{},"publish_time":1477363995139,"_cnpm_publish_time":1477363995139,"_hasShrinkwrap":false}},"readme":"# postcss-modules-sync \n\n> A PostCSS plugin to use CSS Modules synchronously in js.\n\n[![version](https://img.shields.io/npm/v/postcss-modules-sync.svg?style=flat-square)](http://npm.im/postcss-modules-sync)\n[![MIT License](https://img.shields.io/npm/l/postcss-modules-sync.svg?style=flat-square)](http://opensource.org/licenses/MIT)\n\n## Install\n```\nnpm install postcss-modules-sync\n```\n\n## Example\n```js\nimport CSSModulesSync from 'postcss-modules-sync'\nimport postcss from 'postcss'\n\nconst css = `\n  :global .text {\n    color: white;\n    background-color: gray;\n  }\n\n  .green {\n    background-color: green;\n  }\n\n  .blue {\n    background-color: blue;\n  }\n\n  .default {\n    composes: green;\n    display: flex;\n  }\n`\n\nlet exportedTokens = {}\nconst styles = postcss([\n  CSSModulesSync({\n    generateScopedName: '[path][local]-[hash:base64:10]',\n    getJSON: tokens => exportedTokens = tokens\n  })\n]).process(css).css\n\nconsole.log('styles', styles)\nconsole.log('tokens', exportedTokens)\n```","_attachments":{},"homepage":"https://github.com/schiehll/postcss-modules-sync#readme","bugs":{"url":"https://github.com/schiehll/postcss-modules-sync/issues"},"license":"MIT"}