{"bugs":{"url":"https://github.com/robinweser/fela/issues"},"dist":{"shasum":"3079147bfe83b7d2d53bb01ee15feb7c036adf80","tarball":"https://registry.npmjs.org/fela-plugin-extend/-/fela-plugin-extend-12.0.0-rc.2.tgz","fileCount":6,"integrity":"sha512-B3+VyIvh+qCLH7OwqULVFK9TFaar9RE/mc+kEo/yIbyDL0Vj46joqZ6Qlj8hrXgBvkx9IaCFGbcWtTUGyl6VJg==","signatures":[{"sig":"MEQCIA2mDNeyFyZ+FwNSiNQERJlYtJymCY2WomMVyD7eosjMAiAP6QIkXhKPu2p4XIroZvEBqyEOaXZduEu1zhs/WHegnQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12073,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiE9H+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqBug/+Ky4KZson+9LRKUJeakQ3xtDSMbPaJmflhVQ+4tTbJZStYs+6\r\nTE20VE2cWQWR7HSQIyklmt5LMPFSRI9bGBT1/S5KmIPb2ggKhZWwpjKXDgGB\r\nZoL0x+mNMGbL/A773HISn1z3sfpnqNN45RrRzAoSZwtV3++Nk4L34+Fx+Nkw\r\n0zy/wzAe+61tfoQS7kcoVYytnS+E/KKCWQIzLRTeCj+v9do3kB0/okBAfXUD\r\ntIV4S8yMJXYaXyeZ3XocmRj3Ifm57X5hXJ+Yi13BpP0zzSLvSBySG/krGyuv\r\nsFWv/ispFyT8SVmSvMleVHoVz8o4rtACwKs5eb6MDZ55PqhNrGnSHY1jVlgi\r\n0AGuTaocA3gWMA/X75uiK/RxA217XCBMdHCJWw77D4w7tnnUcpdwxxL+45vF\r\nZQN614YD8+q4iAZnCX5lGjsIZTtfbrd2bOsmMP5OgMK5AmEwh+Y+3ju3A0k5\r\nrPJ3R0IyvSV9mnxaAMDT9nL3q5BdhM3OJi3oF2QN041yr20kCiRWoOsGRmNv\r\nnJnOzN5wScEHPctpi429Ny/4kCi/JAWiCSK/ntb3YXqS1+kX7YIwWkq6rkPR\r\nVmvz+JlAkEV1+uu1ZCdMYYgy4c0Ei+WAXavUxtJKLEN1ITGTIEAF611IZQwl\r\nhqs5QNHvNM+auCh0XYW6oN8mDQVoT/IWDjk=\r\n=EppD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","name":"fela-plugin-extend","author":{"name":"Robin Weser"},"module":"es/index.js","readme":"# fela-plugin-extend\n\n<img alt=\"npm version\" src=\"https://badge.fury.io/js/fela-plugin-extend.svg\"> <img alt=\"npm downloads\" src=\"https://img.shields.io/npm/dm/fela-plugin-extend.svg\"> <a href=\"https://bundlephobia.com/result?p=fela-plugin-extend@latest\"><img alt=\"Bundlephobia\" src=\"https://img.shields.io/bundlephobia/minzip/fela-plugin-extend.svg\"></a>\n\nAllows styles to be extended with other style objects. Supports a condition-based API.<br>\nIt automatically removes `null` and `undefined` values **before** merging styles.\n\n## Installation\n```sh\nyarn add fela-plugin-extend\n```\nYou may alternatively use `npm i --save fela-plugin-extend`.\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 extend from 'fela-plugin-extend'\n\nconst renderer = createRenderer({\n  plugins: [ extend() ]\n})\n```\n\n## Example\n\n### `extend: styleObject`\n#### Input\n```javascript\n{\n  color: 'red',\n  extend: { backgroundColor: 'blue' }\n}\n```\n#### Output\n```javascript\n{\n  color: 'red',\n  backgroundColor: 'blue'\n}\n```\n\n### `extend: { condition, styleObject }`\n#### Input\n```javascript\n{\n  color: 'red',\n  extend: {\n    condition: props.bg === true,\n    style: { backgroundColor: 'blue' }\n  }\n}\n```\n#### Output\nRendered using `{ bg: true }` as `props`:\n```javascript\n{\n  color: 'red',\n  backgroundColor: 'blue'\n}\n```\nRendered using `{ bg: false }` as `props`\n```javascript\n{\n  color: 'red'\n}\n```\n\n### `extend: [...]`\nYou can also mix basic and conditional extending.\nIt will extend the styles from left to right.\n```javascript\n{\n  color: 'red',\n  extend: [{\n    fontSize: '12px',\n    lineHeight: 1.5\n  }, {\n    condition: props.bg === true,\n    style: { backgroundColor: 'blue' }\n  }, {\n    lineHeight: 1.2\n  }]\n}\n```\n#### Output\nUsing `{ bg: true }` as `props`:\n```javascript\n{\n  color: 'red',\n  fontSize: '12px',\n  lineHeight: 1.2,\n  backgroundColor: 'blue'\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","extend"],"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 extend style objects","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","fast-loops":"^1.0.0","fela-utils":"^12.0.0-rc.2","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"},"peerDependencies":{"fela":"^11.2.0"},"_npmOperationalInternal":{"tmp":"tmp/fela-plugin-extend_12.0.0-rc.2_1645466110327_0.3322276747561761","host":"s3://npm-registry-packages"},"_id":"fela-plugin-extend@12.0.0-rc.2","version":"12.0.0-rc.2"}