{"_id":"postcss-plugin-px2rem","_rev":"2827621","name":"postcss-plugin-px2rem","description":"A plugin for PostCSS that generates rem units from multi units.","dist-tags":{"latest":"0.8.1"},"maintainers":[{"name":"pigcan","email":"jiangjay818@gmail.com"}],"time":{"modified":"2022-09-06T14:35:34.000Z","created":"2016-06-23T06:09:31.101Z","0.8.1":"2018-12-06T02:36:24.902Z","0.8.0":"2018-11-22T14:14:35.624Z","0.7.0":"2017-02-15T03:56:30.437Z","0.6.0":"2016-06-23T06:46:59.711Z","0.5.0":"2016-06-23T06:09:31.101Z"},"users":{},"author":{"name":"pigcan","email":"jiangjay818@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/ant-tool/postcss-plugin-px2rem.git"},"versions":{"0.8.1":{"name":"postcss-plugin-px2rem","version":"0.8.1","description":"A plugin for PostCSS that generates rem units from multi units.","main":"index.js","scripts":{"compile":"rm -rf lib && babel -d lib src","compile:watch":"npm run compile -- --watch","lint":"eslint src test","prepublish":"npm run compile","test":"babel-node $(npm bin)/babel-istanbul cover $(npm bin)/_mocha -- --no-timeouts","coveralls":"cat ./coverage/lcov.info | coveralls"},"repository":{"type":"git","url":"git+https://github.com/ant-tool/postcss-plugin-px2rem.git"},"keywords":["px","rem","postcss","plugin"],"author":{"name":"pigcan","email":"jiangjay818@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/ant-tool/postcss-plugin-px2rem/issues"},"homepage":"https://github.com/ant-tool/postcss-plugin-px2rem#readme","dependencies":{"postcss":"^5.0.21"},"devDependencies":{"babel-cli":"^6.7.5","babel-core":"^6.7.6","babel-eslint":"^6.0.2","babel-istanbul":"^0.7.0","babel-plugin-add-module-exports":"^0.1.2","babel-preset-es2015":"^6.6.0","babel-preset-stage-0":"^6.5.0","coveralls":"^2.11.9","eslint":"^2.7.0","eslint-config-airbnb":"^6.2.0","expect":"^1.20.1","mocha":"^2.4.5"},"gitHead":"e60b2ca3a8fc34ff0f460f4c336e63a6faede4db","_id":"postcss-plugin-px2rem@0.8.1","_npmVersion":"5.4.2","_nodeVersion":"8.5.0","_npmUser":{"name":"pigcan","email":"jiangjay818@gmail.com"},"dist":{"shasum":"e8adf28fd2befbc079a119126b5c62a88905d5e1","size":4108,"noattachment":false,"key":"/postcss-plugin-px2rem/-/postcss-plugin-px2rem-0.8.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/postcss-plugin-px2rem/download/postcss-plugin-px2rem-0.8.1.tgz"},"maintainers":[{"name":"pigcan","email":"jiangjay818@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postcss-plugin-px2rem_0.8.1_1544063784758_0.22761186582895254"},"_hasShrinkwrap":false,"publish_time":1544063784902,"_cnpm_publish_time":1544063784902,"_cnpmcore_publish_time":"2021-12-14T15:36:10.463Z"},"0.8.0":{"name":"postcss-plugin-px2rem","version":"0.8.0","description":"A plugin for PostCSS that generates rem units from multi units.","main":"index.js","scripts":{"compile":"rm -rf lib && babel -d lib src","compile:watch":"npm run compile -- --watch","lint":"eslint src test","test":"babel-node $(npm bin)/babel-istanbul cover $(npm bin)/_mocha -- --no-timeouts","coveralls":"cat ./coverage/lcov.info | coveralls"},"repository":{"type":"git","url":"git+https://github.com/ant-tool/postcss-plugin-px2rem.git"},"keywords":["px","rem","postcss","plugin"],"author":{"name":"pigcan","email":"jiangjay818@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/ant-tool/postcss-plugin-px2rem/issues"},"homepage":"https://github.com/ant-tool/postcss-plugin-px2rem#readme","dependencies":{"postcss":"^5.0.21"},"devDependencies":{"babel-cli":"^6.7.5","babel-core":"^6.7.6","babel-eslint":"^6.0.2","babel-istanbul":"^0.7.0","babel-plugin-add-module-exports":"^0.1.2","babel-preset-es2015":"^6.6.0","babel-preset-stage-0":"^6.5.0","coveralls":"^2.11.9","eslint":"^2.7.0","eslint-config-airbnb":"^6.2.0","expect":"^1.20.1","mocha":"^2.4.5"},"gitHead":"4d8d288a78ef78275f91f57fc56e0ad13bc7708c","_id":"postcss-plugin-px2rem@0.8.0","_npmVersion":"5.4.2","_nodeVersion":"8.5.0","_npmUser":{"name":"pigcan","email":"jiangjay818@gmail.com"},"dist":{"shasum":"baee3e9108ad5223fa6a7df8e2173c738b428661","size":4054,"noattachment":false,"key":"/postcss-plugin-px2rem/-/postcss-plugin-px2rem-0.8.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/postcss-plugin-px2rem/download/postcss-plugin-px2rem-0.8.0.tgz"},"maintainers":[{"name":"pigcan","email":"jiangjay818@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postcss-plugin-px2rem_0.8.0_1542896075511_0.0021150325349361676"},"_hasShrinkwrap":false,"publish_time":1542896075624,"_cnpm_publish_time":1542896075624,"_cnpmcore_publish_time":"2021-12-14T15:36:10.808Z"},"0.7.0":{"name":"postcss-plugin-px2rem","version":"0.7.0","description":"A plugin for PostCSS that generates rem units from multi units.","main":"index.js","scripts":{"compile":"rm -rf lib && babel -d lib src","compile:watch":"npm run compile -- --watch","lint":"eslint src test","test":"babel-node $(npm bin)/babel-istanbul cover $(npm bin)/_mocha -- --no-timeouts","coveralls":"cat ./coverage/lcov.info | coveralls"},"repository":{"type":"git","url":"git+https://github.com/ant-tool/postcss-plugin-px2rem.git"},"keywords":["px","rem","postcss","plugin"],"author":{"name":"pigcan","email":"jiangjay818@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/ant-tool/postcss-plugin-px2rem/issues"},"homepage":"https://github.com/ant-tool/postcss-plugin-px2rem#readme","dependencies":{"postcss":"^5.0.21"},"devDependencies":{"babel-cli":"^6.7.5","babel-core":"^6.7.6","babel-eslint":"^6.0.2","babel-istanbul":"^0.7.0","babel-plugin-add-module-exports":"^0.1.2","babel-preset-es2015":"^6.6.0","babel-preset-stage-0":"^6.5.0","coveralls":"^2.11.9","eslint":"^2.7.0","eslint-config-airbnb":"^6.2.0","expect":"^1.20.1","mocha":"^2.4.5"},"files":["lib","index.js","package.json","README.md"],"gitHead":"4b9d903290e234919b5557ea25dd29788739a8b9","_id":"postcss-plugin-px2rem@0.7.0","_shasum":"5178cf64d2dc62e98d48d1ccfd053ee4a00e2545","_from":".","_npmVersion":"3.9.5","_nodeVersion":"6.2.2","_npmUser":{"name":"pigcan","email":"jiangjay818@gmail.com"},"dist":{"shasum":"5178cf64d2dc62e98d48d1ccfd053ee4a00e2545","size":2614,"noattachment":false,"key":"/postcss-plugin-px2rem/-/postcss-plugin-px2rem-0.7.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/postcss-plugin-px2rem/download/postcss-plugin-px2rem-0.7.0.tgz"},"maintainers":[{"name":"pigcan","email":"jiangjay818@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/postcss-plugin-px2rem-0.7.0.tgz_1487130988513_0.9290542693343014"},"directories":{},"publish_time":1487130990437,"_hasShrinkwrap":false,"_cnpm_publish_time":1487130990437,"_cnpmcore_publish_time":"2021-12-14T15:36:10.987Z"},"0.6.0":{"name":"postcss-plugin-px2rem","version":"0.6.0","description":"postcss plugin px2rem","main":"index.js","scripts":{"compile":"rm -rf lib && babel -d lib src","compile:watch":"npm run compile -- --watch","lint":"eslint src test","test":"babel-node $(npm bin)/babel-istanbul cover $(npm bin)/_mocha -- --no-timeouts","coveralls":"cat ./coverage/lcov.info | coveralls"},"repository":{"type":"git","url":"git+https://github.com/ant-tool/postcss-plugin-px2rem.git"},"keywords":["px","rem","postcss","plugin"],"author":{"name":"pigcan","email":"jiangjay818@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/ant-tool/postcss-plugin-px2rem/issues"},"homepage":"https://github.com/ant-tool/postcss-plugin-px2rem#readme","dependencies":{"postcss":"^5.0.21"},"devDependencies":{"babel-cli":"^6.7.5","babel-core":"^6.7.6","babel-eslint":"^6.0.2","babel-istanbul":"^0.7.0","babel-plugin-add-module-exports":"^0.1.2","babel-preset-es2015":"^6.6.0","babel-preset-stage-0":"^6.5.0","coveralls":"^2.11.9","eslint":"^2.7.0","eslint-config-airbnb":"^6.2.0","expect":"^1.20.1","mocha":"^2.4.5"},"files":["lib","index.js","package.json","README.md"],"gitHead":"563b99d110051ef24a45bb1c683fadeae2bc83f6","_id":"postcss-plugin-px2rem@0.6.0","_shasum":"1e532c03774e26de2760baedbc40f8b76faca313","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.8.0","_npmUser":{"name":"pigcan","email":"jiangjay818@gmail.com"},"dist":{"shasum":"1e532c03774e26de2760baedbc40f8b76faca313","size":3735,"noattachment":false,"key":"/postcss-plugin-px2rem/-/postcss-plugin-px2rem-0.6.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/postcss-plugin-px2rem/download/postcss-plugin-px2rem-0.6.0.tgz"},"maintainers":[{"name":"pigcan","email":"jiangjay818@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/postcss-plugin-px2rem-0.6.0.tgz_1466664417764_0.1373584612738341"},"directories":{},"publish_time":1466664419711,"_hasShrinkwrap":false,"_cnpm_publish_time":1466664419711,"_cnpmcore_publish_time":"2021-12-14T15:36:11.176Z"},"0.5.0":{"name":"postcss-plugin-px2rem","version":"0.5.0","description":"postcss plugin px2rem","main":"index.js","scripts":{"compile":"rm -rf lib && babel -d lib src","compile:watch":"npm run compile -- --watch","lint":"eslint src test","test":"babel-node $(npm bin)/babel-istanbul cover $(npm bin)/_mocha -- --no-timeouts","coveralls":"cat ./coverage/lcov.info | coveralls"},"repository":{"type":"git","url":"git+https://github.com/ant-tool/postcss-plugin-px2rem.git"},"keywords":["px","rem","postcss","plugin"],"author":{"name":"pigcan","email":"jiangjay818@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/ant-tool/postcss-plugin-px2rem/issues"},"homepage":"https://github.com/ant-tool/postcss-plugin-px2rem#readme","dependencies":{"postcss":"^5.0.21"},"devDependencies":{"babel-cli":"^6.7.5","babel-core":"^6.7.6","babel-eslint":"^6.0.2","babel-istanbul":"^0.7.0","babel-plugin-add-module-exports":"^0.1.2","babel-preset-es2015":"^6.6.0","babel-preset-stage-0":"^6.5.0","coveralls":"^2.11.9","eslint":"^2.7.0","eslint-config-airbnb":"^6.2.0","expect":"^1.20.1","mocha":"^2.4.5"},"files":["lib","index.js","package.json","README.md"],"gitHead":"dc8679bbb396de8425030ddb4d6f53d2419bceb4","_id":"postcss-plugin-px2rem@0.5.0","_shasum":"84c4287faddd7106576b5e56bdd8efce0b4c05d4","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.8.0","_npmUser":{"name":"pigcan","email":"jiangjay818@gmail.com"},"dist":{"shasum":"84c4287faddd7106576b5e56bdd8efce0b4c05d4","size":3539,"noattachment":false,"key":"/postcss-plugin-px2rem/-/postcss-plugin-px2rem-0.5.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/postcss-plugin-px2rem/download/postcss-plugin-px2rem-0.5.0.tgz"},"maintainers":[{"name":"pigcan","email":"jiangjay818@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/postcss-plugin-px2rem-0.5.0.tgz_1466662169080_0.6456436822190881"},"directories":{},"publish_time":1466662171101,"_hasShrinkwrap":false,"_cnpm_publish_time":1466662171101,"_cnpmcore_publish_time":"2021-12-14T15:36:11.380Z"}},"readme":"# postcss-plugin-px2rem\n\n[![NPM version](https://img.shields.io/npm/v/postcss-plugin-px2rem.svg?style=flat)](https://npmjs.org/package/postcss-plugin-px2rem)\n[![Build Status](https://img.shields.io/travis/ant-tool/postcss-plugin-px2rem.svg?style=flat)](https://travis-ci.org/ant-tool/postcss-plugin-px2rem)\n[![Coverage Status](https://img.shields.io/coveralls/ant-tool/postcss-plugin-px2rem.svg?style=flat)](https://coveralls.io/r/ant-tool/postcss-plugin-px2rem)\n[![NPM downloads](http://img.shields.io/npm/dm/postcss-plugin-px2rem.svg?style=flat)](https://npmjs.org/package/postcss-plugin-px2rem)\n[![Dependency Status](https://david-dm.org/ant-tool/postcss-plugin-px2rem.svg)](https://david-dm.org/ant-tool/postcss-plugin-px2rem)\n\npostcss plugin px2rem.\n\n<img align=\"right\" width=\"135\" height=\"95\"\n     title=\"Philosopher’s stone, logo of PostCSS\"\n     src=\"http://postcss.github.io/postcss/logo-leftp.svg\">\n\n## Features\n\nA plugin for PostCSS that generates rem units from pixel units.\n\n## Installation\n\n```bash\n$ npm i --save postcss-plugin-px2rem\n```\n\n## Usage\n\n### input and output\n\n```css\n// input\nh1 {\n  margin: 0 0 20px;\n  font-size: 32px;\n  line-height: 1.2;\n  letter-spacing: 1px;\n}\n\n// output\nh1 {\n  margin: 0 0 0.2rem;\n  font-size: 0.32rem;\n  line-height: 1.2;\n  letter-spacing: 0.01rem;\n}\n```\n\n### original\n\n```javascript\nimport { writeFile, readFileSync } from 'fs';\nimport postcss from 'postcss';\nimport pxtorem from 'postcss-plugin-px2rem';\n\nconst css = readFileSync('/path/to/test.css', 'utf8');\nconst options = {\n  replace: false,\n};\nconst processedCss = postcss(pxtorem(options)).process(css).css;\n\nwriteFile('/path/to/test.rem.css', processedCss, err => {\n  if (err) throw err;\n  console.log('Rem file written.');\n});\n```\n\n### with webpack\n\n```javascript\nimport px2rem from 'postcss-plugin-px2rem';\nconst px2remOpts = {\n  ......\n};\n \nexport default {\n  module: {\n    loaders: [\n      {\n        test: /\\.css$/,\n        loader: 'style-loader!css-loader!postcss-loader',\n      },\n    ],\n  },\n  postcss: [px2rem(px2remOpts)],\n}\n```\n\n### with [atool-build](https://github.com/ant-tool/atool-build)\n\n`webpack.connfig.js`\n\n```javascript\nimport webpack from 'atool-build/lib/webpack';\nimport px2rem from 'postcss-plugin-px2rem';\n\nexport default webpackConfig => {\n  const px2remOpts = {\n    ......\n  };\n  webpackConfig.postcss.push(px2rem(px2remOpts));\n\n  return webpackConfig;\n};\n```\n\n## Configuration\n\nDefault:\n```js\n{\n  rootValue: 100,\n  unitPrecision: 5,\n  propWhiteList: [],\n  propBlackList: [],\n  exclude:false,\n  selectorBlackList: [],\n  ignoreIdentifier: false,\n  replace: true,\n  mediaQuery: false,\n  minPixelValue: 0\n}\n```\n\n- `rootValue` (Number|Object) The root element font size. Default is 100.\n    - If rootValue is an object, for example `{ px: 50, rpx: 100 }`, it will\n    replace rpx to 1/100 rem , and px to 1/50 rem.\n- `unitPrecision` (Number) The decimal numbers to allow the REM units to grow to.\n- `propWhiteList` (Array) The properties that can change from px to rem.\n    - Default is an empty array that means disable the white list and enable all properties.\n    - Values need to be exact matches.\n- `propBlackList` (Array) The properties that should not change from px to rem.\n    - Values need to be exact matches.\n- `exclude` (Reg)  a way to exclude some folder,eg. /(node_module)/.\n- `selectorBlackList` (Array) The selectors to ignore and leave as px.\n    - If value is string, it checks to see if selector contains the string.\n        - `['body']` will match `.body-class`\n    - If value is regexp, it checks to see if the selector matches the regexp.\n        - `[/^body$/]` will match `body` but not `.body`\n- `ignoreIdentifier` (Boolean/String)  a way to have a single property ignored, when ignoreIdentifier enabled, then `replace` would be set to `true` automatically.\n- `replace` (Boolean) replaces rules containing rems instead of adding fallbacks.\n- `mediaQuery` (Boolean) Allow px to be converted in media queries.\n- `minPixelValue` (Number) Set the minimum pixel value to replace.\n\n### License\nMIT\n","_attachments":{},"homepage":"https://github.com/ant-tool/postcss-plugin-px2rem#readme","bugs":{"url":"https://github.com/ant-tool/postcss-plugin-px2rem/issues"},"license":"MIT"}