{"name":"@csstools/postcss-image-function","version":"1.0.1","keywords":["csswg","fallback","image function","postcss-plugin"],"license":"MIT-0","_id":"@csstools/postcss-image-function@1.0.1","maintainers":[{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"alaguna","email":"sombragriselros@gmail.com"},{"name":"romainmenke","email":"romainmenke@gmail.com"}],"contributors":[{"url":"https://antonio.laguna.es","name":"Antonio Laguna","email":"antonio@laguna.es"},{"name":"Romain Menke","email":"romainmenke@gmail.com"}],"homepage":"https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-image-function#readme","bugs":{"url":"https://github.com/csstools/postcss-plugins/issues"},"dist":{"shasum":"b02065426f97fe47d03136084572cc13ad8835c1","tarball":"http://registry-npm.ywwl.com/@csstools/postcss-image-function/download/@csstools/postcss-image-function-1.0.1.tgz","fileCount":6,"integrity":"sha512-6V7+8npoBxVgO3JbIdKqI6eo1NAIQtO0oNSfLSgH439WYB43/kM+GneG4elkgglRo1ppgVhjXxmNqhI+K4pEzg==","signatures":[{"sig":"MEYCIQCDcmL3NVrCbKWmlzhAw/uAK3X+7QawMuQUVxanqg5vpAIhANh1+g0W9sb6DmSmDVrZP22Ja33qav70A7C39Yfq7bMc","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6908,"size":2882,"noattachment":false,"key":"/@csstools/postcss-image-function/-/@csstools/postcss-image-function-1.0.1.tgz"},"type":"module","engines":{"node":">=20.19.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"}},"funding":[{"url":"https://github.com/sponsors/csstools","type":"github"},{"url":"https://opencollective.com/csstools","type":"opencollective"}],"gitHead":"5439880b141f1975292c1d98cee51578eae4af3d","scripts":{},"_npmUser":{"name":"romainmenke","email":"romainmenke@gmail.com"},"repository":{"url":"git+https://github.com/csstools/postcss-plugins.git","type":"git","directory":"plugins/postcss-image-function"},"_npmVersion":"11.13.0","description":"Generate a solid-color image from any color","directories":{},"_nodeVersion":"26.1.0","dependencies":{"@csstools/utilities":"^3.0.0","@csstools/css-tokenizer":"^4.0.0","@csstools/css-parser-algorithms":"^4.0.0","@csstools/postcss-progressive-custom-properties":"^5.1.1"},"_hasShrinkwrap":false,"peerDependencies":{"postcss":"^8.4"},"_npmOperationalInternal":{"tmp":"tmp/postcss-image-function_1.0.1_1782651284744_0.9764295655790449","host":"s3://npm-registry-packages-npm-production"},"readme":"# PostCSS Image Function [<img src=\"https://postcss.github.io/postcss/logo.svg\" alt=\"PostCSS Logo\" width=\"90\" height=\"90\" align=\"right\">][PostCSS]\n\n`npm install @csstools/postcss-image-function --save-dev`\n\n[PostCSS Image Function] lets you easily generate a solid-color image from any color following the [CSS Images 4 Specification].\n\n```css\n.foo {\n\tbackground-image: image(transparent);\n}\n\n.foo {\n\t--bg-image: image(transparent);\n}\n\n/* becomes */\n\n.foo {\n\tbackground-image: linear-gradient(transparent,transparent);\n}\n\n.foo {\n\t--bg-image: linear-gradient(transparent,transparent);\n}\n```\n\n## Usage\n\nAdd [PostCSS Image Function] to your project:\n\n```bash\nnpm install postcss @csstools/postcss-image-function --save-dev\n```\n\nUse it as a [PostCSS] plugin:\n\n```js\nconst postcss = require('postcss');\nconst postcssImageFunction = require('@csstools/postcss-image-function');\n\npostcss([\n\tpostcssImageFunction(/* pluginOptions */)\n]).process(YOUR_CSS /*, processOptions */);\n```\n\n\n\n## Options\n\n### preserve\n\nThe `preserve` option determines whether the original notation\nis preserved. By default, it is not preserved.\n\n```js\npostcssImageFunction({ preserve: true })\n```\n\n```css\n.foo {\n\tbackground-image: image(transparent);\n}\n\n.foo {\n\t--bg-image: image(transparent);\n}\n\n/* becomes */\n\n.foo {\n\tbackground-image: linear-gradient(transparent,transparent);\n\tbackground-image: image(transparent);\n}\n\n.foo {\n\t--bg-image: linear-gradient(transparent,transparent);\n}\n\n@supports (background-image: image(red)) {\n.foo {\n\t--bg-image: image(transparent);\n}\n}\n```\n\n[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test\n[css-url]: https://cssdb.org/#image-function\n[discord]: https://discord.gg/bUadyRwkJS\n[npm-url]: https://www.npmjs.com/package/@csstools/postcss-image-function\n\n[PostCSS]: https://github.com/postcss/postcss\n[PostCSS Image Function]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-image-function\n[CSS Images 4 Specification]: https://drafts.csswg.org/css-images-4/#funcdef-image\n","publish_time":1782651284890,"_cnpm_publish_time":1782651284890,"dist-tags":{"latest":"1.0.8"}}