{"name":"icss-utils","version":"5.1.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":"913a175f0cc2d70fad80b6190e9dce122454a0e0","_id":"icss-utils@5.1.0","_nodeVersion":"12.19.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==","shasum":"c6be6858abd013d768e98366ae47e25d5887b1ae","tarball":"http://registry-npm.ywwl.com/icss-utils/download/icss-utils-5.1.0.tgz","fileCount":9,"unpackedSize":9998,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJftpvvCRA9TVsSAnZWagAAJXQP/Awd3BXCB8YFGEbT1rwg\nTtjMQL7G2kXDFSEVgbPaKMHvF47ptO9yr1N7HuRhK5LRXDIi7jc3+OHKJtsO\nShhMQXk5KwRQ+IktZVrzjzzrOeWMeUI2oHfj58OtGjsGC7HfkxktMMYTE32f\n9ktK82eSri5reHhONnQezWDaU9TaR72cENI5DaGj4XePjmreO9D4vk39Qlis\ne9lWafz6DbxuNwKydY2a5tlzcXva+ogRCIBV35SfzkxNx75DcuW6JUb4BQHY\no+neVEDMIGa9oxuuHqDNKAsi2EeoAq93/GbYiqvNMjUqNnOucRNXYCtX70fl\nUHTgbLTelW0u3MPFzFdldsH3wqnZnWWao7Jk99L+TDaCbloNFjwNkUzl3L2C\ndzKoGGq1YZbI3EqUupaEPq4W7hfPIL+N6UGKD7HDBrhdDbxsxMt28oNEwpK8\nTxdx/bodV37t1MrE1hq5Ilo79bOU509rCRfIELZkTUhpaf/Ucc9/2H8MJ1Iw\nQrNQcB3uq7+Vqp4cNWU+AJm2krRXszpkAnaskz3yWnVrM3dEr+NIvI0mnIo6\nalBm6qAlsgvDZk/WNbA8rINKH3UC584NDzX3rPsJzWBknLkxoLbhIFbbHqqU\nWLmeCYhgFLZCNaXK9F8dr1byP24gXoTUPF3cevZEva7GRgrI37ezuMOBymuQ\n//Bc\r\n=rM4V\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB6ERHjGZrEc314JVml6BNJ5/GIClxuAv8NkaJCnlit9AiA+7hH+Aotn9mR4SsIDyj9opnhWcVEjEjU4Y+//kjDtGQ=="}],"size":4025,"noattachment":false,"key":"/icss-utils/-/icss-utils-5.1.0.tgz"},"_npmUser":{"name":"evilebottnawi","email":"sheo13666q@gmail.com"},"directories":{},"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"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/icss-utils_5.1.0_1605802991413_0.10222344968309405"},"_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":1605802991564,"_cnpm_publish_time":1605802991564,"dist-tags":{"latest":"5.1.0","next":"5.0.0-rc.0"}}