File: //opt/code/node_modules/css-loader/node_modules/icss-utils/package.json
{
"name": "icss-utils",
"version": "2.1.0",
"description": "ICSS utils for postcss ast",
"main": "lib/index.js",
"files": [
"lib"
],
"scripts": {
"build": "babel --out-dir lib src",
"test": "jest --coverage",
"precommit": "lint-staged",
"prepublish": "yarn test && yarn run build"
},
"lint-staged": {
"*.js": [
"eslint",
"prettier --write",
"git add"
]
},
"eslintConfig": {
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"extends": "eslint:recommended"
},
"babel": {
"presets": [
[
"env",
{
"targets": {
"node": 4
}
}
]
]
},
"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": "^6.0.1"
},
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-jest": "^20.0.3",
"babel-preset-env": "^1.5.1",
"eslint": "^3.19.0",
"husky": "^0.13.3",
"jest": "^20.0.3",
"lint-staged": "^3.4.2",
"prettier": "^1.3.1"
},
"readme": "[](https://travis-ci.org/css-modules/icss-utils)\r\n\r\n# ICSS Utils \r\n\r\n## replaceSymbols\r\n\r\nGoverns the way tokens are searched & replaced during the linking stage of ICSS loading.\r\n\r\nThis is broken into its own module in case the behaviour needs to be replicated in other PostCSS plugins\r\n(i.e. [CSS Modules Values](https://github.com/css-modules/postcss-modules-values))\r\n\r\n```js\r\nimport { replaceSymbols, replaceValueSymbols } from \"icss-utils\"\r\nreplaceSymbols(css, replacements)\r\nreplaceValueSymbols(string, replacements)\r\n```\r\n\r\nWhere:\r\n\r\n- `css` is the PostCSS tree you're working with\r\n- `replacements` is an JS object of `symbol: \"replacement\"` pairs, where all occurrences of `symbol` are replaced with `replacement`.\r\n\r\nA symbol is a string of alphanumeric, `-` or `_` characters. A replacement can be any string. They are replaced in the following places:\r\n\r\n- In the value of a declaration, i.e. `color: my_symbol;` or `box-shadow: 0 0 blur spread shadow-color`\r\n- In a media expression i.e. `@media small {}` or `@media screen and not-large {}`\r\n\r\n## extractICSS(css, removeRules = true)\r\n\r\nExtracts and remove (if removeRules is equal true) from PostCSS tree `:import` and `:export` statements.\r\n\r\n```js\r\nimport postcss from 'postcss';\r\nimport { extractICSS } from 'icss-utils'\r\n\r\nconst css = postcss.parse(`\r\n :import(colors) {\r\n a: b;\r\n }\r\n :export {\r\n c: d;\r\n }\r\n`)\r\n\r\nextractICSS(css)\r\n/*\r\n {\r\n icssImports: {\r\n colors: {\r\n a: 'b'\r\n }\r\n },\r\n icssExports: {\r\n c: 'd'\r\n }\r\n }\r\n*/\r\n```\r\n\r\n## createICSSRules(icssImports, icssExports)\r\n\r\nConverts icss imports and exports definitions to postcss ast\r\n\r\n```js\r\ncreateICSSRules({\r\n colors: {\r\n a: 'b'\r\n }\r\n}, {\r\n c: 'd'\r\n})\r\n```\r\n\r\n## License\r\n\r\nISC\r\n\r\n---\r\nGlen Maddern and Bogdan Chadkin, 2015.\r\n",
"readmeFilename": "README.md",
"_id": "icss-utils@2.1.0",
"dist": {
"shasum": "f9b138edf5d2b51f5375289d22474e9f289865aa"
},
"_from": "icss-utils@^2.1.0",
"_resolved": "http://registry.npmjs.org/icss-utils/-/icss-utils-2.1.0.tgz"
}