{"bugs":{"url":"https://github.com/robinweser/fela/issues"},"dist":{"shasum":"03abc002111328aa9626e14b07fc88aa0d4d0596","tarball":"https://registry.npmjs.org/fela-plugin-unit/-/fela-plugin-unit-12.0.0-rc.2.tgz","fileCount":6,"integrity":"sha512-n6PuT2aUUOGZEVTR/7dzui4xkhPBU1CDWEBFgk/67WM4mmEIKam6npZZPeIvWr2fQWBN9iY/PW+D5WaXhxYg/Q==","signatures":[{"sig":"MEQCIAF+1O+l2TNd/yMoNi5V/wGfJAMoApJlZtOqGTJ/D3BFAiAC/N33x2dv6xV7+9vZrsGJhl4XXQ9JVit4wct47T1Jzw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14470,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiE9H8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo3cQ//Z2wX+oFQXWgTB5BmmK8cERBB/klUst9QaEQaOCi68YHGzFKG\r\ndrnVhGP0bl4MNtEg6g9d8Zfo09b4BCd6jb16IBZgjtMiXcqdJPKTUpjbUpWt\r\nWuWauDrT82jki9Xg9iaPnJvsCBgr0udHqX0icKmhRLy4JwfLz3ZF0aD4kmlr\r\niZBkZhp0qITK/fe4w2o9Tgz+QwUNhDw/0EKaKXN9gggIXRK+ZW0WIxDTu3w0\r\nwAIkXz9/GtsfrxYkxYOAggODyT8h+OCnBNd+SGEQWZyw9MQvOPtL9e3H/w7/\r\nFngLbVL7sfPPLv+kuTqOCxzV75NaPDkEgN2GS5IsB9Ed5D47jw9c2LWPKwss\r\nWgtOfnxw1pU/QLNPG2e4NoTNeVnnzB4BxKqF/rJQhgFMznX2gsCYkSwbaWby\r\njnHrNCJmX7y6I7Pb1aoDrdM6/w7qr9YsGOjz26G14W7xyo+s9VHT7WltsudM\r\n2e/1qiHiCiPZ6fNo3B2f3cRk7EEQcLbOvAO71+fAnSRoN4dKV4ZsfcwvuAbY\r\nZYm9HqyejEpxS6yu7dMK5OrET9BI3wYTjCPSZmAPbdVE5Dka1UPzpMFY9iZG\r\nbsa0mnWiI91rvzC0VZz8lFyHiJ3CalxxIcpWPmqYc/LUeRlVyLtuZrbFx4fp\r\nkhpFI5pwTNBH0k4FMV3088Zp0lCFgbGNYOg=\r\n=fQRh\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":"0e5e638041a6a62e52128dbac21e9c5f21d80b66","license":"MIT","scripts":{"test":"jest --config=jest.config.js","build":"pnpm clean && pnpm build:es && pnpm build:lib","clean":"rimraf lib es coverage","setup":"pnpm build","watch":"npm run watch:lib & npm run watch:es","build:es":"babel src --out-dir es --ignore **/__tests__","coverage":"pnpm test --coverage","watch:es":"babel src -d es -w","build:lib":"cross-env BABEL_ENV=commonjs babel src --out-dir lib --ignore **/__tests__","build:umd":"webpack --config webpack.config.js","watch:lib":"BABEL_ENV=commonjs babel src -d lib -w"},"_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/4.0.0/node@v14.18.2+arm64 (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":"14.18.2","dependencies":{"isobject":"^4.0.0","css-in-js-utils":"^3.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.0","rimraf":"^3.0.0","webpack":"^4.41.6","cross-env":"^6.0.3","@babel/cli":"^7.2.0","babel-core":"7.0.0-bridge.0","babel-jest":"^26.6.0","@babel/core":"^7.2.2","@babel/node":"^7.13.0","webpack-cli":"^3.3.10","babel-loader":"^8.2.3","@babel/polyfill":"^7.7.0","@babel/preset-env":"^7.5.5","clean-webpack-plugin":"^3.0.0","@babel/plugin-transform-modules-commonjs":"^7.5.0"},"_npmOperationalInternal":{"tmp":"tmp/fela-plugin-unit_12.0.0-rc.2_1645466107894_0.6284430990465069","host":"s3://npm-registry-packages"},"_id":"fela-plugin-unit@12.0.0-rc.2","version":"12.0.0-rc.2"}