{"name":"@csstools/postcss-image-function","description":"Generate a solid-color image from any color","version":"1.0.2","contributors":[{"name":"Antonio Laguna","email":"antonio@laguna.es","url":"https://antonio.laguna.es"},{"name":"Romain Menke","email":"romainmenke@gmail.com"}],"license":"MIT-0","funding":[{"type":"github","url":"https://github.com/sponsors/csstools"},{"type":"opencollective","url":"https://opencollective.com/csstools"}],"engines":{"node":">=20.19.0"},"type":"module","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"}},"dependencies":{"@csstools/css-parser-algorithms":"^4.0.0","@csstools/css-tokenizer":"^4.0.0","@csstools/postcss-progressive-custom-properties":"^5.1.2","@csstools/utilities":"^3.0.0"},"peerDependencies":{"postcss":"^8.4"},"scripts":{},"homepage":"https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-image-function#readme","repository":{"type":"git","url":"git+https://github.com/csstools/postcss-plugins.git","directory":"plugins/postcss-image-function"},"bugs":{"url":"https://github.com/csstools/postcss-plugins/issues"},"keywords":["csswg","fallback","image function","postcss-plugin"],"gitHead":"5153ff3d3cd8b15c0376c461f199a520bbb38fec","_id":"@csstools/postcss-image-function@1.0.2","_nodeVersion":"26.1.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-P6y1oL5tBnJRitYe4FmHnW4zoDd5grCFWOnEsTkfAXhTJCy+lZ1wqUuluDIT2JYnhwKrOcyBmWEN/qFB9SlGHQ==","shasum":"908d45817c707b2ce8426fbfc05e53b3132d1313","tarball":"http://registry-npm.ywwl.com/@csstools/postcss-image-function/download/@csstools/postcss-image-function-1.0.2.tgz","fileCount":6,"unpackedSize":6910,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCpoWUTO61rBILyzxrHL2Ew1poSdwIaHU+1ATXkmioUIwIhAJJrW7XeEhiavIPLpdn4NnbeGm87aCsfi439KD4XJXKq"}],"size":2884,"noattachment":false,"key":"/@csstools/postcss-image-function/-/@csstools/postcss-image-function-1.0.2.tgz"},"_npmUser":{"name":"romainmenke","email":"romainmenke@gmail.com"},"directories":{},"maintainers":[{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"alaguna","email":"sombragriselros@gmail.com"},{"name":"romainmenke","email":"romainmenke@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/postcss-image-function_1.0.2_1786812423833_0.2842017175600342"},"_hasShrinkwrap":false,"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":1786812423979,"_cnpm_publish_time":1786812423979,"dist-tags":{"latest":"1.0.8"}}