{"name":"icss-utils","version":"5.0.0","description":"ICSS utils for postcss ast","main":"src/index.js","engines":{"node":"^10 || ^12 || >= 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/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","devDependencies":{"coveralls":"^3.1.0","eslint":"^7.9.0","eslint-config-prettier":"^6.12.0","husky":"^4.3.0","jest":"^26.4.2","lint-staged":"^10.4.0","postcss":"^8.1.0","prettier":"^2.1.2"},"peerDependencies":{"postcss":"^8.1.0"},"gitHead":"329fbaad0040c3b1aa3bcbfcf65c326aa531da38","_id":"icss-utils@5.0.0","_nodeVersion":"10.15.2","_npmVersion":"6.14.8","dist":{"integrity":"sha512-aF2Cf/CkEZrI/vsu5WI/I+akFgdbwQHVE9YRZxATrhH4PVIe6a3BIjwjEcW+z+jP/hNh+YvM3lAAn1wJQ6opSg==","shasum":"03ed56c3accd32f9caaf1752ebf64ef12347bb84","tarball":"http://registry-npm.ywwl.com/icss-utils/download/icss-utils-5.0.0.tgz","fileCount":9,"unpackedSize":8476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhJ6qCRA9TVsSAnZWagAAjp4P/RHJ67kI7fiDGjIOE2MY\nQ/zpb2BR6iJWiF1UWE6LA7Qgtgwk/79A7uKIBjCRoiJqKOl1PAZXnDN3Q7VF\nNe5IrXFaM9ihu+gLO+anAcV4PsOzNlUUO/td0nO2nlURUIZBfsRurHXZ9BDP\noB8SV0b4MJ3ROeYMW0cAd9NaZV/sz9krB8RPKYaPxQ5VV72ybqbXm2fslK9A\n7VEB9Pu800DJtxYtSjsDwTfQScalTDUc3ehT3fhTyigEyZOA3kBIQ/7/A19O\nBYOym/ODXi1aumu0p0YiQUwGrCPStKgbfoVJn7b4YFPy2G1jrivuGfVLAexb\noRtyXwhuizB9CWsZSgAZKFScGgEeilaPC3uROCFHIYeR/HlVc62zSNl2D02Z\nbmKrbHMvomk5n4uxAX0omAcTmTP2jSoeA6ZkWKR9lgER9W9OluJ7YX2UNrCp\nEDW4FU7DbthsHlM8Gf81Rvsgkv3pR2HqsjIvkKxtP3bnvXT1vCZsphVCGbH+\nHXrxDwTSUnJVUBtSdbCu4YqmhnITb1474CSf4ARPiD/5D1pd51u5PNF4+DRm\nBXCWoB78GOGPPtOj4JZT1fWXV0QUQAW0vAhTx/4j2fCb0FsEvIkPxM2rSz+L\nBLD/yfElwaqN7cZtT8l4CClYjJDOyZ/TVYd8n9Stl9rFFwYVHa5Xq0zg7iPc\ns1nT\r\n=tZzr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcofV2G2p+6TYr3a1eHnYPMOYm5hI56R1NC8RB3uMozgIgMZdMSIkqMXFDjz9rRvdPRnvMntGyrTedrOza7te13uQ="}],"size":3586,"noattachment":false,"key":"/icss-utils/-/icss-utils-5.0.0.tgz"},"maintainers":[{"name":"trysound","email":"trysound@yandex.ru"},{"name":"sullenor","email":"iamhoneyboy@gmail.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/icss-utils_5.0.0_1602526890287_0.47248083882242353"},"_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":1602526890414,"_cnpm_publish_time":1602526890414,"dist-tags":{"latest":"5.1.0","next":"5.0.0-rc.0"}}