{"bugs":{"url":"https://github.com/robinweser/fela/issues"},"dist":{"shasum":"7e25eabd8f408bf5ce43369ce677d5fe5e72e043","tarball":"https://registry.npmjs.org/fela-plugin-unit/-/fela-plugin-unit-12.0.0-y.0.tgz","fileCount":6,"integrity":"sha512-7Jv+HeUAfX9NmkcweAYqT8AP40Nq1O9y1m/m/3Iju7v/rtsvVXDX848K43yym7u3Y6mEHj3r8eo0LjcGgbffsQ==","signatures":[{"sig":"MEUCIH1H75iCFRJjhXk2mdZXe0xxM7/jWPycz+5UAD9uX/dmAiEAn2SSPvnxWPtkYefFbwWSeN3ZAULmF88E97ugFWtEf6o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15406,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFRpmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo9mg//fWF8vEzTkqguUkgmDMjbzcrzhH+qikFXirw8GjRbWstKfbSu\r\noai0ARpEeLgMs77jFPWrRFhuqrNWajZ7CqoNm9e4MuH5+Vb0mZuWUnk2OYEq\r\nZVJtOQdxIyvBzJu8ync5WHqfUn2HeGrDdbddZ0JwCb0gDBPWTJc68FYgSRjy\r\nlx0hLDzodKYRFF02hSGhZwXtxVriJXT/b+j++CFMVTWngAeJIB2gDhmXEpuM\r\nBF5udyA4LLHHvIdpO3AstaDwKjVwgylQlC57BhkfvomRyBuaTRRD6helU/wb\r\nlEuUBaHvSkOv+hTvvP/R19WeEN0UwjQVHgkmxjkVmzfXdzpy8WfhSPxWIUaM\r\ntWEsy96tks+jVlmZyaOt2hZbTcoN4BCVpPza+XjJAPLg3Os2CfLnelw8S+Ny\r\nUFIj0mCsnkU4uFbtEF4MpxQFKpDhnuWYtWHZHHD/qcq8+hC3VlM85cfRyitS\r\nHMRFhi4pDensDQca3D1KXdaSTLs5DI7Pb21YKRQm3U1Ve+giI78uVm3CKJjr\r\nSQkvyg1Y5YtbceV2JvdAxnMZgvwhvxGMrmO6zaEy4k/tqSeaS5tZ7ZhTN0V5\r\njuKB5WMXTMrK6iXdVxB/6BPpapHj8imMRx71GjeMkW0eNFS45U53kX0GGBci\r\neqdmLsorQeWf1JouXcjI7Fe0+y4WzgQkfrM=\r\n=TvQF\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":"26804548dae15e08097785c19be45d072fee217e","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-y.0_1645550182095_0.15748579246554684","host":"s3://npm-registry-packages"},"_id":"fela-plugin-unit@12.0.0-y.0","version":"12.0.0-y.0"}