{"name":"@csstools/postcss-image-function","description":"Generate a solid-color image from any color","version":"1.0.3","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.3","@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":"32958f853774515e447940beee80aa3bc7eb215f","_id":"@csstools/postcss-image-function@1.0.3","_nodeVersion":"26.1.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-xEt0juUL09VQhyelxuQqgircEkAM2FUSOY/cMqVxz2oy1h7WMI2HvMeG8ryFqlKcZ51IDHTx9Rh1HlzWW8z+wA==","shasum":"3533b2034234d8f90f2fc606a02a38593acdfa9c","tarball":"http://registry-npm.ywwl.com/@csstools/postcss-image-function/download/@csstools/postcss-image-function-1.0.3.tgz","fileCount":6,"unpackedSize":6912,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCHmvFyT4Kpq5C9tA5Ss8Rxe8gyf238Qn/gvzpGZHHKmAIhAJuaCXfSt4xiIMqYqBDlhRvGFh+l2NC8bAU/ECdpFKJd"}],"size":2882,"noattachment":false,"key":"/@csstools/postcss-image-function/-/@csstools/postcss-image-function-1.0.3.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.3_1788708794074_0.5984044488379889"},"_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":1788708794218,"_cnpm_publish_time":1788708794218,"dist-tags":{"latest":"1.0.8"}}