{"name":"icss-utils","version":"4.1.1","description":"ICSS utils for postcss ast","main":"lib/index.js","engines":{"node":">= 6"},"scripts":{"lint":"eslint . --ignore-path .gitignore","build":"babel --out-dir lib src","pretest":"npm run lint","test":"npm run test:only","test:only":"jest","prepublish":"yarn test && yarn run build"},"babel":{"presets":[["@babel/preset-env",{"targets":{"node":6}}]]},"eslintConfig":{"parser":"babel-eslint","parserOptions":{"sourceType":"module"},"env":{"es6":true,"jest":true},"extends":"eslint:recommended"},"lint-staged":{"*.js":["prettier --write","eslint","git add"]},"husky":{"hooks":{"pre-commit":"lint-staged"}},"repository":{"type":"git","url":"git+https://github.com/css-modules/icss-utils.git"},"keywords":["css","modules","icss","postcss"],"author":{"name":"Glen Maddern"},"license":"ISC","bugs":{"url":"https://github.com/css-modules/icss-utils/issues"},"homepage":"https://github.com/css-modules/icss-utils#readme","dependencies":{"postcss":"^7.0.14"},"devDependencies":{"@babel/cli":"^7.1.0","@babel/core":"^7.1.0","@babel/preset-env":"^7.1.0","babel-eslint":"^10.0.1","babel-jest":"^24.1.0","eslint":"^5.14.1","husky":"^1.3.1","jest":"^24.1.0","lint-staged":"^8.1.4","prettier":"^1.16.4"},"gitHead":"f3ae4d5193d5ac7a3fb5a469e9cc198d75f520b4","_id":"icss-utils@4.1.1","_nodeVersion":"10.15.2","_npmVersion":"6.9.0","dist":{"integrity":"sha512-4aFq7wvWyMHKgxsH8QQtGpvbASCf+eM3wPRLI6R+MgAnTCZ6STYsRvttLvRWK0Nfif5piF394St3HeJDaljGPA==","shasum":"21170b53789ee27447c2f47dd683081403f9a467","tarball":"http://registry-npm.ywwl.com/icss-utils/download/icss-utils-4.1.1.tgz","fileCount":8,"unpackedSize":9469,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc7p/TCRA9TVsSAnZWagAA9NMP/2R519LPzXdpKrFPdpWs\n6Y1VwtyWyfvw6nyH/8wZI73XH8HyFUJHpxiyGJNjL+QZ7R/CDdDE+DL2MrkR\nKhOaUQqJdAFBBQ2JbzbuBFXeO9Ea6kTjhK7vQ0zP+AXaLRwykbmjJcOx1wOl\nVN9hiAMrhUenHpLc7mRhRvoA/1ot1sXwPosbJ1efwDWLKMzA3cvHv958+BHr\nQaSBMTCT7CBYVm5H/kyr3L2152f9/y623SeNS7Sq82/NF8ZUuaxr1zEDbb9K\n1i2hqsIOKtZDZL9w/+eQi4olanHiL/8R8chR7ernCo1h8ABTpn/IUNO9NE30\nK+J/tIwRRqYEYHSN7BVgi5OrKj+XTHBt0XTYFGPuNujSpTNfhSf2iIB1dBbl\nuXmNkltYc4IFKB2OBXo+Zl75wN+gP2tPdFjo3u/BE9ByKkR/ML/i5bwaspYs\nG0EBJb9hzRktT7ssYjZs99t43pH5Nvs5uux6whguzogqoSbJ2yVJL8KoYltx\nU66hxg/avQVT0g7s5CPV/P+ETwGdlmLKnlacD6neCS90jzXvceqZ2yH2OfhU\nwFDvXKh+oO55VZLiFe4UG/KMcj3n0Loug8O+ep7fTetyLT9HsxYp9CEQq4vd\nReSBnwt8PsxPmKe7zYN/78yWD8+vVQe2SdOxIzMYV70evFUVrtZF6dkvuWF2\nA+nn\r\n=gJNB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1oMhQCav5+FCm5hIRbcxJNWvE2Ck6vwYN+FQmvNRbGgIgXNdSMPxrx3U04DocKTThtE6RLegaN4KgwPpoYu10/rc="}],"size":3461,"noattachment":false,"key":"/icss-utils/-/icss-utils-4.1.1.tgz"},"maintainers":[{"name":"geelen","email":"hi@glenmaddern.com"},{"name":"trysound","email":"trysound@yandex.ru"}],"_npmUser":{"name":"evilebottnawi","email":"sheo13666q@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/icss-utils_4.1.1_1559142355157_0.15676088525841547"},"_hasShrinkwrap":false,"readme":"[![Build Status](https://travis-ci.org/css-modules/icss-utils.svg)](https://travis-ci.org/css-modules/icss-utils)\n\n# ICSS Utils\n\n## replaceSymbols\n\nGoverns the way tokens are searched & replaced during the linking stage of ICSS loading.\n\nThis is broken into its own module in case the behaviour needs to be replicated in other PostCSS plugins\n(i.e. [CSS Modules Values](https://github.com/css-modules/postcss-modules-values))\n\n```js\nimport { replaceSymbols, replaceValueSymbols } from \"icss-utils\";\n\nreplaceSymbols(css, replacements);\nreplaceValueSymbols(string, replacements);\n```\n\nWhere:\n\n- `css` is the PostCSS tree you're working with\n- `replacements` is an JS object of `symbol: \"replacement\"` pairs, where all occurrences of `symbol` are replaced with `replacement`.\n\nA symbol is a string of alphanumeric, `-` or `_` characters. A replacement can be any string. They are replaced in the following places:\n\n- In the value of a declaration, i.e. `color: my_symbol;` or `box-shadow: 0 0 blur spread shadow-color`\n- In a media expression i.e. `@media small {}` or `@media screen and not-large {}`\n\n## extractICSS(css, removeRules = true, mode = 'auto')\n\nExtracts and remove (if removeRules is equal true) from PostCSS tree `:import`, `@icss-import`, `:export` and `@icss-export` statements.\n\n```js\nimport postcss from \"postcss\";\nimport { extractICSS } from \"icss-utils\";\n\nconst css = postcss.parse(`\n  :import(colors) {\n    a: b;\n  }\n  :export {\n    c: d;\n  }\n`);\n\nextractICSS(css);\n/*\n  {\n    icssImports: {\n      colors: {\n        a: 'b'\n      }\n    },\n    icssExports: {\n      c: 'd'\n    }\n  }\n*/\n```\n\nBy default both the pseudo and at-rule form of the import and export statements\nwill be removed. Pass the `mode` option to limit to only one type.\n\n## createICSSRules(icssImports, icssExports, mode = 'rule')\n\nConverts icss imports and exports definitions to postcss ast\n\n```js\ncreateICSSRules(\n  {\n    colors: {\n      a: \"b\",\n    },\n  },\n  {\n    c: \"d\",\n  },\n  // Need pass `rule` and `decl` from postcss\n  // Please look at `Step 4` https://evilmartians.com/chronicles/postcss-8-plugin-migration\n  postcss\n);\n```\n\nBy default it will create pseudo selector rules (`:import` and `:export`). Pass\n`at-rule` for `mode` to instead generate `@icss-import` and `@icss-export`, which\nmay be more resilient to post processing by other tools.\n\n## License\n\nISC\n\n---\n\nGlen Maddern, Bogdan Chadkin and Evilebottnawi 2015-present.\n","publish_time":1559142355307,"_cnpm_publish_time":1559142355307,"dist-tags":{"latest":"5.1.0","next":"5.0.0-rc.0"}}