{"bugs":{"url":"https://github.com/robinweser/fela/issues"},"dist":{"shasum":"e638f7f3d8d294b6a5ef6a44843267c9ce2c66a4","tarball":"https://registry.npmjs.org/fela-plugin-extend/-/fela-plugin-extend-12.0.0-y.0.tgz","fileCount":6,"integrity":"sha512-0zdplZBDhf96y48C01yeAhW3EgdmR5FbjI5HAZG4m9LsZb8sBxBuPSi3f86BLinRe+uN1FNWGaLKv2+RA1RNSA==","signatures":[{"sig":"MEUCIQDWRkpG1bh2lqiCY01caet1NIds3ea4V3SorQmttAN/HgIgPy/5kO2xcnqeR+W4EX/iimIYKBWwbZcW0JK7V2yQiic=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12216,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFRpnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmogJhAAhF2XJBO6ZBTd6tT0oj3lVWpIbpIFOHWhG9OmLI9ZcCUCC8V6\r\n4eBTSSbZMu7O4IByBk3pXFwCAz+TTKdA6U6eLDQDYRzDcYZ6R2aLOaLiDI9h\r\nyYjEZmlHFKMEtSA1/hLokB5hXZ7jjEWQTH9pve8On44ufEmGwyEKeGsC4MN/\r\nrISftn+k1kK001gUcmfEFtcDRFEESAFSui+lq4MHcRnlAC7WVi1TJ+/4iso2\r\nbqZ+URFXiD7TWDufUL9Avt7YrkYtoiVWvGEEjkVX4bC5Gn12OsA2SsrAAQL1\r\nH7J1tCU2FgUSzouh+5RBX+A8zkvo0xkRguYwWMEolxqLgiroTAyXvspTkEIg\r\nxe8Uz7AD+e94QGFQC6FhkWWnBlGBJS4CXA7lWaIPxwUlPrZbKolumIBMx3gL\r\nbQCXwMTWSjyKxaMM4b8cf9G8mvJP8SAV7YMtV8LC99MBiYxffEFv83wVPy/v\r\nikLYUPC3B04H8ITzsQ78MNh1YeeesrWT5aYjatpo6jnAZ496AoHtnAlB8RHF\r\noe8DXMZpCGsRS71u9yy2hjV/s5RmK1630HDShcKaaD0pv74lKHNdCTD8CEHk\r\n6uNQXnlg/K+hFaOatzHxErJHbcdEoTlI5Zky5dZRtKTXpI1GPIAMUSlARvx0\r\nH1KMozT4o+6LrfILw3aDAxWoDncEpdDaJJg=\r\n=f1Zf\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\n```sh\nyarn add fela-plugin-extend\n```\n\nYou may alternatively use `npm i --save fela-plugin-extend`.\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 extend from 'fela-plugin-extend'\n\nconst renderer = createRenderer({\n  plugins: [extend()],\n})\n```\n\n## Example\n\n### `extend: styleObject`\n\n#### Input\n\n```javascript\n{\n  color: 'red',\n  extend: { backgroundColor: 'blue' }\n}\n```\n\n#### Output\n\n```javascript\n{\n  color: 'red',\n  backgroundColor: 'blue'\n}\n```\n\n### `extend: { condition, styleObject }`\n\n#### Input\n\n```javascript\n{\n  color: 'red',\n  extend: {\n    condition: props.bg === true,\n    style: { backgroundColor: 'blue' }\n  }\n}\n```\n\n#### Output\n\nRendered using `{ bg: true }` as `props`:\n\n```javascript\n{\n  color: 'red',\n  backgroundColor: 'blue'\n}\n```\n\nRendered using `{ bg: false }` as `props`\n\n```javascript\n{\n  color: 'red'\n}\n```\n\n### `extend: [...]`\n\nYou can also mix basic and conditional extending.\nIt will extend the styles from left to right.\n\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\n#### Output\n\nUsing `{ bg: true }` as `props`:\n\n```javascript\n{\n  color: 'red',\n  fontSize: '12px',\n  lineHeight: 1.2,\n  backgroundColor: 'blue'\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","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-y.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"},"peerDependencies":{"fela":"^11.2.0"},"_npmOperationalInternal":{"tmp":"tmp/fela-plugin-extend_12.0.0-y.0_1645550183368_0.5594478724287126","host":"s3://npm-registry-packages"},"_id":"fela-plugin-extend@12.0.0-y.0","version":"12.0.0-y.0"}