{"_id":"@csstools/postcss-image-function@1.0.8","bugs":{"url":"https://github.com/csstools/postcss-plugins/issues"},"dist":{"shasum":"797c095eaceb61d55ffdd4d4291d5f8e71fb8c39","tarball":"http://registry-npm.ywwl.com/@csstools/postcss-image-function/download/@csstools/postcss-image-function-1.0.8.tgz","fileCount":6,"integrity":"sha512-MX4UogkVvGm4Q4jGr9PGujT+3qMy3oT5gAcgwaqtBeT9UVuzakCbjRFRPVwm8y1fnUT5rdWDk26cucsvLrVSkQ==","signatures":[{"sig":"MEYCIQC4WZGydkGkkB5KWzRMqy1Nk6tqkMxR31xG99Uu+rBxIAIhANMdOycGYUu6uyym9NrvsMIkc2qKDHR6xM4851XIKHMg","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFgZaXOS0pMs2PSDxxHy2+AMtPtuz40EyPKfdDOm/Fs/AiEArqZkkbUgtej3faWu8kuLXMr/JIu+wMFnZK6yK6Z4IKw="}],"unpackedSize":7465,"size":3020,"noattachment":false,"key":"/@csstools/postcss-image-function/-/@csstools/postcss-image-function-1.0.8.tgz"},"name":"@csstools/postcss-image-function","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":"1ac4c3e5b02898f5bba27b98d4da59093a029ee8","license":"MIT-0","scripts":{},"version":"1.0.8","_npmUser":{"name":"romainmenke","email":"romainmenke@gmail.com"},"homepage":"https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-image-function#readme","keywords":["color","css","csswg","fallback","function","image","image-function","postcss","postcss-plugin"],"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":{},"maintainers":[{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"alaguna","email":"sombragriselros@gmail.com"},{"name":"romainmenke","email":"romainmenke@gmail.com"}],"_nodeVersion":"26.1.0","contributors":[{"url":"https://antonio.laguna.es","name":"Antonio Laguna","email":"antonio@laguna.es"},{"name":"Romain Menke","email":"romainmenke@gmail.com"}],"dependencies":{"@csstools/utilities":"^3.0.0","@csstools/css-tokenizer":"^4.0.3","@csstools/css-parser-algorithms":"^4.0.3","@csstools/postcss-progressive-custom-properties":"^5.1.5"},"_hasShrinkwrap":false,"peerDependencies":{"postcss":"^8.4"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/postcss-image-function_1.0.8_1794919787801_0.3167939241902098"},"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":1794919787909,"_cnpm_publish_time":1794919787909,"dist-tags":{"latest":"1.0.8"}}