{"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","tarball":"http://registry-npm.ywwl.com/postcss-plugin-px2rem/download/postcss-plugin-px2rem-0.5.0.tgz","integrity":"sha512-wOlXz0SbMQWyXhcCKwTED5XMtzZVe5eK3eTTQbkQYbF6lgVLq6Y3RfP26JMnAqH8DPaaELs+/Mpv42lD3or9gw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDr6CcX9F0JgvOLo9ryQs+naBOO0eGs3WyK7w5URiSmWAIhAJ7K5gbbeW8ccuLKAgqdx+rZYCCGqhfz3BKX7TCXuo58"}],"size":3539,"noattachment":false,"key":"/postcss-plugin-px2rem/-/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":{},"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":1466662171101,"_cnpm_publish_time":1466662171101,"dist-tags":{"latest":"0.8.1"}}