{"bugs":{"url":"https://github.com/robinweser/fela/issues"},"dist":{"shasum":"5cb7a320054686791d755cf0c8199bd8f00ea3cf","tarball":"https://registry.npmjs.org/fela-plugin-unit/-/fela-plugin-unit-12.0.0-rc.1.tgz","fileCount":6,"integrity":"sha512-75oTdgwZQ5D9RARmvJQmv8HbxY8l/nKolOuFaErkNn43DzGDiIs01dwt17W9f9roWDSaq5B3wPLpvYEsXvWgHQ==","signatures":[{"sig":"MEQCIH6hp50mwyijvKxpeIF29KsN89RO6RGVbggyAHfw5DtgAiBOA2KvHWQLO7PX4SBYT1EZWvctzDdw/cG8X5SnMrpPUA==","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\nwsFzBAEBCAAGBQJiD3Y0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqGkQ/+MypJ5mP8u3thMSyOtWCCVdhpMcfHsjGQoehDpkciY0UUoBzm\r\ncW44b4zzwtPGeQtXkpHv+pYofE12cPR8L9n+om3BkhABVnLuridAM8QNY0Oi\r\nplTvfaY/V/YxCEv8aoYBuvg2Pe/qYCeIlp7xItTbwh4q3lOd9UbzrwQsCebz\r\nCno6lR9h8c8FLH/aLv73+Blh1A1o4v/RC+sCiSHiue/+2bSXxmMaQZDhEoFL\r\nV43H0jo6E2ZjwyPsoWW/Khqpl7S6SLo6pbioDumZ5ngNwyEraqu18MVkVCHk\r\nlQLyHKJCQEyzgqfe7mDs8hdFUtEwSKqe0sXrAW5oIrJVO0utnnRc6g3hdoxe\r\n+8TilLu5ZBXjD6FCCmrd6vYsUw9h7kVrACWnTVWW9WgPdCZYVbgsAsFeKvFE\r\nmAojLFEIBZmRGdCqFIF+7tCvoLaoqe45RRiL+lgorzCOn6e5BTtomf3fEc+c\r\nY6WltefFI+/gQpwBA+RPvAhQH1mXjoKWsXqENtLkm8p/GX1yuvROz6ynFLTZ\r\nFGEqIdDIxjB1zpViBfig7PgpRR5bEeEljdvsmRpUO+cejDgRSF6B4Irj8rnn\r\nOx9gYx+Id0LVcJCSKXbrOykosOcduQ3pLT9BuVH7aoa0S55dZZNIyyYL4zgd\r\n2DFEFEXyg7DNKBC1ArU7CdVR6rAtbkaeI4k=\r\n=awkP\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":"20e073d04b1a97beb6a099e160b0813db845a5e9","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.1_1645180468697_0.6106864638552731","host":"s3://npm-registry-packages"},"_id":"fela-plugin-unit@12.0.0-rc.1","version":"12.0.0-rc.1"}