{"bugs":{"url":"https://github.com/robinweser/fela/issues"},"dist":{"shasum":"49f9e42a28c78befe6cc41402c149c3fdf2bc58d","tarball":"https://registry.npmjs.org/fela-plugin-unit/-/fela-plugin-unit-12.0.0-rc.3.0.tgz","fileCount":6,"integrity":"sha512-BlJ1q/C/w/qBcNXQT8f3dp9vzY11hsMJMWl4y7Q42fPfom/0kSPf949tPSJiKf5PauspNoK1XI9xr0tRKruBHw==","signatures":[{"sig":"MEYCIQDL89Q1y3RKR5yC9duEZmTqvAYZaGiBWgOkD2m0UWLVOAIhAL4IqgBpdaL4+718GssC+p43qu9CYJuT/6xZYHvfbAZ/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15409,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFR00ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpZPhAAoEWABhtDzFEyM8CUBx+IxXpHKQOJRItK3D77SK5NFV82NpTY\r\nsZrrit8oxvntKOeEWP4+EKNUHHVzdgdP9ZEWbir6NSWfaC7jIgtQG+vdOYPo\r\ntyFnEt7bnkHp84G3baWmHZikYOnucWj/jaNyCNOHFUEzKLcsUw6MSdIhHVxJ\r\nuy0c1svklBHdqWnArVcY2QQrHldQoLPyg8y1Fza0Pty7hmB44DE+QaHRYAr5\r\ny9yfcJ1GuweKc4VBRTlmcb5lZX/EL62kso0HPzUmSdtzmaR4hm0ZYj2vKPjq\r\n8+i69hPJHF0u7x9zqGrnYb4VfL6Riry0T+vfBJBFKIr6Asy3NhrIiy4HcrsP\r\nR4GdXi52PnugESdF9sA+lvNbqo2NG9dlnRdVIZ4HDOvp4w2Wlwgq0HAUpHOv\r\ns7ZkKwbbdPK6PKcsAZmSC68CnvIWamL/Xxj8y1Jt3Hcu3wVuRORkpwuXa1RD\r\nKwmKAR/n/Gx5vTt6qT6zlKJihxB3Fkh7r3OQZsdMJBKBz+ky0ohbtXXrp4w/\r\nvIUWjeP87Jd1qttXYNhQFBL5axtBV2uQcZS3ruyjcVAHgDQuigTm9Wp1m6KA\r\nXL5SLxK8Q+pcNQBwr62rf3IvKmqgWKtGGxKWLmFeZVr/VprWVlrkVC7vHEKI\r\nbcdWkYYAFgtvvX8bbTjvNBrOwnjgwJNPTOY=\r\n=yIpk\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\n```sh\nyarn add fela-plugin-unit\n```\n\nYou may alternatively use `npm i --save fela-plugin-unit`.\n\n## Usage\n\nMake sure to read the documentation on [how to use plugins](https://fela.js.org/docs/latest/advanced/plugins#using-plugins).\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\n##### Parameters\n\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\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## Example\n\nUsing the above example code:\n\n#### Input\n\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\n#### Output\n\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\n\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":"71e887614179a10c85332e326cf1d943ca51289a","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.3.0_1645550900005_0.831818961009601","host":"s3://npm-registry-packages"},"_id":"fela-plugin-unit@12.0.0-rc.3.0","version":"12.0.0-rc.3.0"}