{"bugs":{"url":"https://github.com/robinweser/fela/issues"},"dist":{"shasum":"4614ba4e509e100fc5fd2312e454640e51e71e5e","tarball":"https://registry.npmjs.org/fela-plugin-unit/-/fela-plugin-unit-11.5.0-rc.0.tgz","fileCount":5,"integrity":"sha512-/cXn5nyLqNF4MVsrRIhrEAhykUWRvH9/TZgeQjyBWj/o/jfnX2Z6AMOi9RTwn6i1/T8uazx/3iO26r4MyK3wyA==","signatures":[{"sig":"MEYCIQDzsAbO0WPwl4nvkqc034UwuSqWr7CJV6awc7bg4Kjk3wIhAKLx5KHO/0R+szIXZyFAJrA7HxhWE4a1CT8faPd1KtS2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9931,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfz1SdCRA9TVsSAnZWagAANewP+QHGqBDR5XRT74FLM0lW\nTSV6iXH76Cc0zWG2i3fwL3PKYmKKNWI0azfA16jMwsH98IyQPIAfMIIg1kYi\nNPJusfPehIUMtpWuX0XdDcB9P+tdM3BMwEMJEUPEeFHAW+Ku6bqWhkhPmfM5\nEywiFzmzzc7ifFqHUGbC3PQxTAe/3c7CNnGRZxvaQC4yzBteiylVdYNOLPjm\nrm+ImZMQIH3iQXcE0q5c0RTQ5Hb+STvlpt5CpG9mh4M0LHgzDwzw3hsiugci\nyZ2gSZBjEdvuvZk8Hc0rSI4PzMWa7JuXIqaSKPt5kUnpsJUdIrCxgTDFvy1f\nM+S14HxOxhEudSGiP7ui1ATajmnv2qCTSP+toyR8/eBl8xEpDz9SM/mBEXqq\nUmZTGG5xUEOr38HbcD6z7sys7gY9CnjKkUotgS0hkyV4r0n82kcAyizu8nZC\n3nWZlqhEc14tTePWM+NG8J7/qpNmn04PrDQpA7RplXxARKIJdZVyCSiy83x9\n9Uwb291Sqv2Gc1U+PEuxxphmsloH7Vw6U2TEndLyRAXOlWZPmk3M3L2puvbc\nL/PPlq0fM/Q6JaGdrQ7MNUTTWFTCZaXvxlM/5maD5iajs28Fe0pY3rOLoPU2\nmJnFjyObUpVi34g7kfLT+1KIuUhcX7GXJ205EEfWJ34oEFAgNU2x+k/cUd2C\njtUC\r\n=POtl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","name":"fela-plugin-unit","author":{"name":"Robin Weser"},"module":"es/index.js","readme":"# fela-plugin-unit\n\n<img alt=\"npm version\" src=\"https://badge.fury.io/js/fela-plugin-unit.svg\"> <img alt=\"npm downloads\" src=\"https://img.shields.io/npm/dm/fela-plugin-unit.svg\"> <a href=\"https://bundlephobia.com/result?p=fela-plugin-unit@latest\"><img alt=\"Bundlephobia\" src=\"https://img.shields.io/bundlephobia/minzip/fela-plugin-unit.svg\"></a>\n\nAlways writing length values as string with a value applied seems not like the JavaScript way to do it. You can also use mathematics to process number values. <br>\nIt is aware of unitless properties such as `lineHeight`, zero-values and also adds units to multiple values inside an array.\n\n## Installation\n```sh\nyarn add fela-plugin-unit\n```\nYou may alternatively use `npm i --save fela-plugin-unit`.\n\n\n\n## Usage\nMake sure to read the documentation on [how to use plugins](http://fela.js.org/docs/advanced/Plugins.html).\n\n```javascript\nimport { createRenderer } from 'fela'\nimport unit from 'fela-plugin-unit'\n\nconst renderer = createRenderer({\n  plugins: [ unit() ]\n})\n```\n\n### Configuration\n##### Parameters\n| Parameter | Value | Default | Description |\n| --- | --- | --- | --- |\n| unit | `ch`, `em`, `ex`, `rem`, `vh`, `vw`, `vmin`, `vmax`, `px`, `cm`, `mm`, `in`, `pc`, `pt`, `mozmm` | `px` | unit which gets applied |\n| unitPerProperty | *(Object)* | `{}` | Default units per property |\n| isUnitlessProperty | *(Function)* | [`util function`](https://github.com/robinweser/css-in-js-utils/blob/master/modules/isUnitlessProperty.js) | check whether property should remain unitless |\n\n##### Example\n```javascript\nimport { createRenderer } from 'fela'\nimport unit from 'fela-plugin-unit'\n\nconst unitPlugin = unit('em', {\n  margin: '%',\n  fontSize: 'pt'\n})\n\nconst renderer = createRenderer({\n  plugins: [ unitPlugin ]\n})\n```\n\n\n## Example\nUsing the above example code:\n\n#### Input\n```javascript\n{\n  marginTop: 0,\n  width: 25,\n  lineHeight: 1.4,\n  height: '53',\n  fontSize: 15,\n  margin: 10\n}\n```\n#### Output\n```javascript\n{\n  marginTop: 0,\n  width: '25em',\n  lineHeight: 1.4,\n  height: '53em',\n  fontSize: '15pt',\n  margin: '10%'\n}\n```\n\n## License\nFela is licensed under the [MIT License](http://opensource.org/licenses/MIT).<br>\nDocumentation is licensed under [Creative Commons License](http://creativecommons.org/licenses/by/4.0/).<br>\nCreated with ♥ by [@robinweser](http://weser.io) and all the great contributors.\n","gitHead":"6d457d39e69e1471bddaea8591c50745f95070d9","license":"MIT","_npmUser":{"name":"rofrischmann","email":"robin@weser.io"},"homepage":"https://github.com/robinweser/fela#readme","keywords":["fela","fela-plugin","cssinjs"],"repository":{"url":"git+https://github.com/robinweser/fela.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v12.18.3+x64 (darwin)","description":"Fela plugin to automatically add units if required","directories":{},"jsnext:main":"es/index.js","maintainers":[{"name":"rofrischmann","email":"robin@weser.io"},{"name":"txhawks","email":"tofu.hawks@gmail.com"}],"sideEffects":false,"_nodeVersion":"12.18.3","dependencies":{"isobject":"^3.0.1","css-in-js-utils":"^3.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/fela-plugin-unit_11.5.0-rc.0_1607423133258_0.4474135986535197","host":"s3://npm-registry-packages"},"_id":"fela-plugin-unit@11.5.0-rc.0","version":"11.5.0-rc.0"}