{"bugs":{"url":"https://github.com/robinweser/fela/issues"},"dist":{"shasum":"156b4d29fed3783b82a2d89afcf61e6e86759bc8","tarball":"https://registry.npmjs.org/fela-plugin-unit/-/fela-plugin-unit-12.0.0-rc.0.tgz","fileCount":6,"integrity":"sha512-t+ofbjjnd36kbJCtfMn1/pl9ixHPcLkPnS0ouKruHJg5HqR5w9Oj0jYXFwbfCplorPJZXO1zd7cFBTPn3JjM8Q==","signatures":[{"sig":"MEUCIFOBo2kkusV5FbAjZjojeNmJRS7+sCVTF1bcnMXVvWIKAiEAus/cAhidYLif8aR/q6ddmJylzCQWFhjLh29IwRVHv8U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14551,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiDS7FCRA9TVsSAnZWagAAuiMP/i0fccxhN1PeS8j7QaRP\n/uQrPzH/b9XZHl/hOREQiSUCrDIye9yn2qgYKGxUrVoVJRNkgoluiVU9sp7a\ni+9NoXkbbWwa9hD0UIn547E9PJzGpHokE10ivatj2pfm/dWDZhJijW5XYRyy\nm+VOszZlU/qzZ9780/qv4GLu0+Pr6ARvQWaEobbRQDFWykz9rtvLcg1bl9ld\nzL0AU7BeBCCzgguIeMASARXESp3bpv5SA4VETriX93eB46QQ1/Y7nHJbcpeO\nwtc36T6SSL50fZmhhwxyRPtWFEtavdikH19q5fc3OtbKGnq4dgx0rRgSJq3A\nEfpMhHSaAJ96RL+QYYqq+xODeyNVt3wBFelvp6gyoqSNq7OSB4kovwqtrRH1\nJ1TDnP9fNpuPSE4H0lMXTfPBsatwMNwRHZvCfUH1HoWpXCBf5sWCdE3KzhUc\nwbFpx1ssNR6hnhayHO2+qvd/VPCgiqg47N1dT6H/BYea2XXYvx3DrMfrNBSz\ng1P/CPqP8XQzzR1wazb8h6mOiax4FvQy37yZj1jt/H0FEwwKe0YdFDjZtC+H\nt0Nt/gjOJGNcam9jediLLaLj4nhjekl9IYegiUX5ykY8uXIFTmL2UazS71Zs\nRhSec6y/oypNFaCmNeJTTYGrbH/xsahLqOdjPizUJOpX7OLGR5rJtnSF5mEI\naXyw\r\n=L7de\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":"00f02f410f17a7693479ea3349bb3a9f223359af","license":"MIT","scripts":{"test":"jest --config=jest.config.js","build":"yarn clean && yarn build:es && yarn build:lib","clean":"rimraf lib es coverage","setup":"yarn build","watch":"npm run watch:lib & npm run watch:es","build:es":"babel src --out-dir es --ignore **/__tests__","coverage":"yarn 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":"^3.0.1","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.0_1645031109012_0.48769767244420037","host":"s3://npm-registry-packages"},"_id":"fela-plugin-unit@12.0.0-rc.0","version":"12.0.0-rc.0"}