{"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":{"integrity":"sha512-/InLV+lzIpyFHEtJAHAm0wR9Ub9xnIMIMJ3aZBwm0FOEY5fWs77l8ebslHIN5cAKucuu6erc1sI2ytUg054qow==","shasum":"baee3e9108ad5223fa6a7df8e2173c738b428661","tarball":"http://registry-npm.ywwl.com/postcss-plugin-px2rem/download/postcss-plugin-px2rem-0.8.0.tgz","fileCount":5,"unpackedSize":11093,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9rnMCRA9TVsSAnZWagAAWmEQAIhDoprXS14UMz1dg6RE\nnFtpVUYQhnNF0HeRCB+M2YPI11ZQOu5cHRKT2z7Y0XZOIkWhy+6x/HQMwcB4\nZoOF06nsnmk2BY4in5lUCbl8pbCydgF+F41LsghTxng+9W6vBbXDI/sqhsyy\n3enwTMtdaqqkJzLcmdN/He/Jfhipv6Z1PZ7Uv2y0W9ZbdOfys0t/WDfBjl+I\ninCcICF030Tn+FpISzQVJoeBoeqTrMzvJLWlqhdIBVpG092NZPgbP+GxuLIm\n+SFTK9Bhz25L9RZU4uSLsaqW42uAWZPwcL/UTxahzleHysePWCrYuqyu9tNw\nPnYIMPbmB6sQfK3UDTvQQc9TndxDw6Ug0+/351atgFht+NM3re81N6m8lmBh\n6hgba6HFMAn4glMgSfcoP7zA1OdfX8/fMOsNmi2/KJ961uyIjX0lATMuJHtY\nySY27jcLA1p76KtZ03Ropgnya8zhIurTMSGPtO5Rb5vbzK3IrRqh6jVRhnNK\nUg+9HrUrgNUb171M++LgAl9Cfw+SgwuejtG/1AJ9XLifWod3TTxKJup3539N\nixgGs9E1oJJ/Uzhx4QfgG+Xbo16S4r4TaYmkwvnSbURlWo4s13lXCz8NFw9b\nAUtTGJR24SHoJZa42JTxg2kPbLM0UNyRTxXJ+hCprkgSi8Tzh7Nb9yojzSfx\n3eUS\r\n=Lt6Q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGaZ3aTCZD9v1fMbPCI1JdcgTo11NczkBCQiMu7Zbz0BAiBQ3/vSy5K17ud9qRRN9d91HVE97fPEqZ8lWDMgybCKFg=="}],"size":4054,"noattachment":false,"key":"/postcss-plugin-px2rem/-/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,"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","publish_time":1542896075624,"_cnpm_publish_time":1542896075624,"dist-tags":{"latest":"0.8.1"}}