{"name":"@csstools/postcss-gradients-interpolation-method","version":"2.0.1","keywords":["color","conic","css","gradients","interpolation","linear","postcss","postcss-plugin","radial","repeating","syntax"],"author":{"name":"Jonathan Neal","email":"jonathantneal@hotmail.com"},"license":"CC0-1.0","_id":"@csstools/postcss-gradients-interpolation-method@2.0.1","homepage":"https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-gradients-interpolation-method#readme","bugs":{"url":"https://github.com/csstools/postcss-plugins/issues"},"dist":{"shasum":"ca050e89bb528a948507afb71fa04da437dce846","tarball":"http://registry-npm.ywwl.com/@csstools/postcss-gradients-interpolation-method/download/@csstools/postcss-gradients-interpolation-method-2.0.1.tgz","fileCount":10,"integrity":"sha512-HGnR7v1fF/KAx/Vo1qW7wUvfFOIv3OQ1pXET3qHQjk2fw/IE4Nf85gLNhD+j80oprAgLz18EvftDOHTYC96Ezw==","signatures":[{"sig":"MEUCIQDfUR6OQUNUNDwKndTaZ2BjCryVXSYegDRFu2OPbeWq+wIgUWbsjw3ul5wZHMTvthY6ZiMvkKBODcsWE82iMGMZzgs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27931,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj1NFxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoBXA/+I3Z3cffJe4xnVQcmyNJT3hwvGWcKHOWOfKXhtf5Zwn5CvKv9\r\nO6DKLFsPBYknqJkUIa9ouvxTJ9crpEwuehxk63u9WIVq/aUSP98eznCcpt1F\r\ny0D7In6J9rYnJ16ta9KNj1kLV7i58H7QzI8SormaJqThwNJs3Pg7Bmu2T+r+\r\nLpDnMkqU7vyEgQ4FxG7REN6N8AVd0mcK6TMbjb6ziaWKH93fWC92w9eL3aTa\r\nUQ3ip8uyYEBzzltkFGl6MEyjZAXy4Q6oi2+n4GmKs41b7IC4qlOZhTkUDL43\r\nD2jhjAtQ8CAdL7H4GO2vZ6fWwlmMKSvXpWLp/VE07xr4mkepIEnyFxlccS24\r\nmD0o1n9+eOnlvyoJAmvHEnEjTg9YruqrX6263kqAf/VYaXQWeB93UW1SihUN\r\nU1w8qwhETGETCVtCtQxR0DMhgpAwRGwfV/yUSsSISlrLG8jwzWhLxDVATzNy\r\njSDgDgHP9zYmaqoaMdcDWpNMdIyPBPMwlU73Uj9CEmS1sxvLeb66334xtAvO\r\n1Hgy9q9h7NfINpBtPdnvz5l9SOgCNwSXeK9CX5jbD4unIHqke2z086WaKCZm\r\nycDUVz2M09zwe8pXNuvnVqRzI6dWkR6qiLwUL+6g+jSYJ8IcwlFEdiUpWXun\r\nXIgBnz7f7vBdCVTXwrcIOw2VB9qpMT147a0=\r\n=DZWp\r\n-----END PGP SIGNATURE-----\r\n","size":7189,"noattachment":false,"key":"/@csstools/postcss-gradients-interpolation-method/-/@csstools/postcss-gradients-interpolation-method-2.0.1.tgz"},"main":"dist/index.cjs","types":"dist/index.d.ts","volta":{"extends":"../../package.json"},"module":"dist/index.mjs","engines":{"node":"^14 || ^16 || >=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","default":"./dist/index.mjs","require":"./dist/index.cjs"}},"funding":{"url":"https://opencollective.com/csstools","type":"opencollective"},"gitHead":"90b230db4bfaef084db55f8824328403a8aae0af","scripts":{"docs":"node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs","lint":"npm run lint:eslint && npm run lint:package-json","test":"node .tape.mjs && npm run test:exports","build":"rollup -c ../../rollup/default.mjs","clean":"node -e \"fs.rmSync('./dist', { recursive: true, force: true }); fs.mkdirSync('./dist');\"","prebuild":"npm run clean","lint:eslint":"eslint ./src --ext .js --ext .ts --ext .mjs --no-error-on-unmatched-pattern","test:exports":"node ./test/_import.mjs && node ./test/_require.cjs","prepublishOnly":"npm run clean && npm run build && npm run test","lint:package-json":"node ../../.github/bin/format-package-json.mjs","test:rewrite-expects":"REWRITE_EXPECTS=true node .tape.mjs"},"_npmUser":{"name":"alaguna","email":"sombragriselros@gmail.com"},"csstools":{"cssdbId":"TODO","specUrl":"https://drafts.csswg.org/css-images-4/#linear-gradients","exportName":"postcssGradientsInterpolationMethod","humanReadableName":"PostCSS Gradients Interpolation Method"},"repository":{"url":"git+https://github.com/csstools/postcss-plugins.git","type":"git","directory":"plugins/postcss-gradients-interpolation-method"},"_npmVersion":"8.18.0","description":"Use interpolation methods in CSS gradient functions","directories":{},"_nodeVersion":"18.8.0","dependencies":{"postcss-value-parser":"^4.2.0","@csstools/postcss-progressive-custom-properties":"^2.0.0"},"_hasShrinkwrap":false,"peerDependencies":{"postcss":"^8.4"},"_npmOperationalInternal":{"tmp":"tmp/postcss-gradients-interpolation-method_2.0.1_1674891633732_0.6393898818371808","host":"s3://npm-registry-packages"},"readme":"# PostCSS Gradients Interpolation Method [<img src=\"https://postcss.github.io/postcss/logo.svg\" alt=\"PostCSS Logo\" width=\"90\" height=\"90\" align=\"right\">][PostCSS]\n\n[<img alt=\"npm version\" src=\"https://img.shields.io/npm/v/@csstools/postcss-gradients-interpolation-method.svg\" height=\"20\">][npm-url] [<img alt=\"Build Status\" src=\"https://github.com/csstools/postcss-plugins/workflows/test/badge.svg\" height=\"20\">][cli-url] [<img alt=\"Discord\" src=\"https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white\">][discord]<br><br>[<img alt=\"Baseline Status\" src=\"https://cssdb.org/images/badges-baseline/gradients-interpolation-method.svg\" height=\"20\">][css-url] [<img alt=\"CSS Standard Status\" src=\"https://cssdb.org/images/badges/gradients-interpolation-method.svg\" height=\"20\">][css-url] \n\n```bash\nnpm install @csstools/postcss-gradients-interpolation-method --save-dev\n```\n\n[PostCSS Gradients Interpolation Method] lets you use different interpolation methods in CSS gradient functions following [CSS Images Module 4].\n\n```pcss\n.example {\n\tbackground-image: linear-gradient(in oklch, hsl(0deg 85% 75%) 0%, hsl(180deg 80% 65%) 100%);\n}\n\n:root {\n\t--background-image: linear-gradient(in oklab, hsl(96, 42%, 24%) 0%, hsl(302, 67%, 25%) 100%);\n}\n\n/* becomes */\n\n.example {\n\tbackground-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(248, 146, 114), rgb(244, 158, 94), rgb(235, 171, 82), rgb(220, 185, 81), rgb(201, 199, 95), rgb(177, 211, 118), rgb(151, 221, 146), rgb(125, 229, 177), rgb(103, 235, 208), rgb(94, 237, 237) 100%);\n\tbackground-image: linear-gradient(in oklch, hsl(0deg 85% 75%) 0%, hsl(180deg 80% 65%) 100%);\n}\n\n:root {\n\t--background-image: linear-gradient(rgb(56, 87, 35) 0%, rgb(64, 83, 46), rgb(70, 79, 54), rgb(76, 74, 62), rgb(82, 69, 68), rgb(86, 64, 75), rgb(91, 58, 81), rgb(95, 51, 87), rgb(99, 44, 93), rgb(103, 34, 98), rgb(106, 21, 104) 100%);\n}\n\n@supports (background: linear-gradient(in oklch, red 0%, red 0% 1%, red 2%)) {\n:root {\n\t--background-image: linear-gradient(in oklab, hsl(96, 42%, 24%) 0%, hsl(302, 67%, 25%) 100%);\n}\n}\n```\n\n## Shortcomings\n\n> [!CAUTION]\n> Color stops with only a color or only an interpolation hint are not supported.\n\nFor best results you should always provide at least the color and position for each color stop.\nDouble position color stops are supported.\n\n```pcss\n.foo {\n\t/* Only a color: can't transform */\n\tbackground-image: linear-gradient(in oklch, black 0%, green, blue 100%);\n\n\t/* Only an interpolation hint: can't transform */\n\tbackground-image: linear-gradient(in oklch, black 0%, 25%, blue 100%);\n}\n```\n\n> [!CAUTION]\n> Variable colors are not supported.\n> We can not mix colors when the color is a variable.\n\n```pcss\n.foo {\n\t--red: red;\n\t/* Color stop variable : can't transform */\n\tbackground-image: linear-gradient(in oklch, black 0%, var(--red), blue 100%);\n}\n```\n\n## Usage\n\nAdd [PostCSS Gradients Interpolation Method] to your project:\n\n```bash\nnpm install postcss @csstools/postcss-gradients-interpolation-method --save-dev\n```\n\nUse it as a [PostCSS] plugin:\n\n```js\nconst postcss = require('postcss');\nconst postcssGradientsInterpolationMethod = require('@csstools/postcss-gradients-interpolation-method');\n\npostcss([\n\tpostcssGradientsInterpolationMethod(/* pluginOptions */)\n]).process(YOUR_CSS /*, processOptions */);\n```\n\n[PostCSS Gradients Interpolation Method] runs in all Node environments, with special\ninstructions for:\n\n- [Node](INSTALL.md#node)\n- [PostCSS CLI](INSTALL.md#postcss-cli)\n- [PostCSS Load Config](INSTALL.md#postcss-load-config)\n- [Webpack](INSTALL.md#webpack)\n- [Next.js](INSTALL.md#nextjs)\n- [Gulp](INSTALL.md#gulp)\n- [Grunt](INSTALL.md#grunt)\n\n## Options\n\n### preserve\n\nThe `preserve` option determines whether the original notation\nis preserved. By default, it is preserved.\n\n```js\npostcssGradientsInterpolationMethod({ preserve: false })\n```\n\n```pcss\n.example {\n\tbackground-image: linear-gradient(in oklch, hsl(0deg 85% 75%) 0%, hsl(180deg 80% 65%) 100%);\n}\n\n:root {\n\t--background-image: linear-gradient(in oklab, hsl(96, 42%, 24%) 0%, hsl(302, 67%, 25%) 100%);\n}\n\n/* becomes */\n\n.example {\n\tbackground-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(248, 146, 114), rgb(244, 158, 94), rgb(235, 171, 82), rgb(220, 185, 81), rgb(201, 199, 95), rgb(177, 211, 118), rgb(151, 221, 146), rgb(125, 229, 177), rgb(103, 235, 208), rgb(94, 237, 237) 100%);\n}\n\n:root {\n\t--background-image: linear-gradient(rgb(56, 87, 35) 0%, rgb(64, 83, 46), rgb(70, 79, 54), rgb(76, 74, 62), rgb(82, 69, 68), rgb(86, 64, 75), rgb(91, 58, 81), rgb(95, 51, 87), rgb(99, 44, 93), rgb(103, 34, 98), rgb(106, 21, 104) 100%);\n}\n```\n\n### enableProgressiveCustomProperties\n\nThe `enableProgressiveCustomProperties` option determines whether the original notation\nis wrapped with `@supports` when used in Custom Properties. By default, it is enabled.\n\n> [!NOTE]\n> We only recommend disabling this when you set `preserve` to `false` or if you bring your own fix for Custom Properties.  \n> See what the plugin does in its [README](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties#readme).\n\n```js\npostcssGradientsInterpolationMethod({ enableProgressiveCustomProperties: false })\n```\n\n```pcss\n.example {\n\tbackground-image: linear-gradient(in oklch, hsl(0deg 85% 75%) 0%, hsl(180deg 80% 65%) 100%);\n}\n\n:root {\n\t--background-image: linear-gradient(in oklab, hsl(96, 42%, 24%) 0%, hsl(302, 67%, 25%) 100%);\n}\n\n/* becomes */\n\n.example {\n\tbackground-image: linear-gradient(rgb(245, 137, 137) 0%, rgb(248, 146, 114), rgb(244, 158, 94), rgb(235, 171, 82), rgb(220, 185, 81), rgb(201, 199, 95), rgb(177, 211, 118), rgb(151, 221, 146), rgb(125, 229, 177), rgb(103, 235, 208), rgb(94, 237, 237) 100%);\n\tbackground-image: linear-gradient(in oklch, hsl(0deg 85% 75%) 0%, hsl(180deg 80% 65%) 100%);\n}\n\n:root {\n\t--background-image: linear-gradient(rgb(56, 87, 35) 0%, rgb(64, 83, 46), rgb(70, 79, 54), rgb(76, 74, 62), rgb(82, 69, 68), rgb(86, 64, 75), rgb(91, 58, 81), rgb(95, 51, 87), rgb(99, 44, 93), rgb(103, 34, 98), rgb(106, 21, 104) 100%);\n\t--background-image: linear-gradient(in oklab, hsl(96, 42%, 24%) 0%, hsl(302, 67%, 25%) 100%);\n}\n```\n\n_Custom properties do not fallback to the previous declaration_\n\n[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test\n[css-url]: https://cssdb.org/#gradients-interpolation-method\n[discord]: https://discord.gg/bUadyRwkJS\n[npm-url]: https://www.npmjs.com/package/@csstools/postcss-gradients-interpolation-method\n\n[PostCSS]: https://github.com/postcss/postcss\n[PostCSS Gradients Interpolation Method]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-gradients-interpolation-method\n[CSS Images Module 4]: https://drafts.csswg.org/css-images-4/#linear-gradients\n","publish_time":1674891633906,"maintainers":[{"name":"romainmenke","email":"romainmenke@gmail.com"},{"name":"alaguna","email":"sombragriselros@gmail.com"},{"name":"jonathantneal","email":"jonathantneal@hotmail.com"}],"_cnpm_publish_time":1674891633906,"dist-tags":{"latest":"6.0.17"}}