{"name":"@csstools/postcss-gradients-interpolation-method","version":"1.0.0","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@1.0.0","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":"06f19cf658b932712fde43a32beea13a5e92b3d7","tarball":"http://registry-npm.ywwl.com/@csstools/postcss-gradients-interpolation-method/download/@csstools/postcss-gradients-interpolation-method-1.0.0.tgz","fileCount":10,"integrity":"sha512-XIyCJpnvSPH0C+yeBUwSjiD6LTWJBlK5lhrp1++cg0RPTqN58igZDiEQ8CwT9vkNktq0afFpBmWPcIFi1iSNdA==","signatures":[{"sig":"MEUCIQChqo5vZCo5m1LQqwiDYqWIhoCaV5yjI/AD33pJ8IHx6AIgKpi3BTViPvh1HH7+UmVO6lTe+xk/3Eaj94Dg4lB+7IY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27310,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiIoE8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqAEQ//RiIh52ecno9MQui3eBVCTyNEBgAZCaUNP6TP4yUOrFSEUZhz\r\ngmnME06xYrXP6Eyo5Pf87gTWZWgppD/4IJ+46bV7JqCq21z8cxgZ42X8hFd5\r\nH1rhjnAzOJSd+Jafsd62BwKW/QldVSFm/r7WSHneDMAEQ4V1fF/O5JJtVD+b\r\n2sLN57xDrlQ6muSLvHHPTcqTc39+A6cdvVgrllUrIhZ73mGNIuQxFqtaBZsm\r\nlcKC6DaOYWPL/Gef5QyhlyUtpdACg6K6Yoi4BoBjNw5Lq7hhQ2Tftpr3Flop\r\nre1+fqPiVzXtC+y+wszzdH5nKWnYIBqv1FZkda2ZQCMrUMO6tnYFbFPkpzFL\r\nJOspDdAW1DXYagqmaCgc7ptnYSkVdh2ZwiuhtS6ct4Pha0eWPGr4t8yNiyh/\r\nfwj/JnZKNZy14hUENjgW33WbqSz/o9wXGMUUhmDurKvw2SsFuUYUEYPzjrED\r\n9mzZNS2Hb5ovBDeLdX5BObUDEd5u9xNnA/qm38+cKK30HGx/Yr9oZeft1p9q\r\nBZ9+kAWfs7ol8kiV1e+fywrw6AF93WCV/uUupZdf2ccItStQPIQcPZWGidN7\r\nwWZ1i2gTm68pfxMTabTZKLRTv03oNBHgpWx3tpfvC3MxLX59uCj9iLlRGGCD\r\nt+R0J8r3SbScTGYFHM9EWgYRKkF38dK7IL8=\r\n=XfkB\r\n-----END PGP SIGNATURE-----\r\n","size":7511,"noattachment":false,"key":"/@csstools/postcss-gradients-interpolation-method/-/@csstools/postcss-gradients-interpolation-method-1.0.0.tgz"},"main":"dist/index.cjs","types":"dist/index.d.ts","volta":{"extends":"../../package.json"},"module":"dist/index.mjs","engines":{"node":"^12 || ^14 || >=16"},"exports":{".":{"import":"./dist/index.mjs","default":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"27749d3193b455cff13811c1d0593c28c12f5d2a","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.js","clean":"node -e \"fs.rmSync('./dist', { recursive: true, force: true });\"","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.1.2","description":"Use interpolation methods in CSS gradient functions","directories":{},"_nodeVersion":"16.13.1","_hasShrinkwrap":false,"devDependencies":{"postcss-value-parser":"^4.2.0","@csstools/postcss-progressive-custom-properties":"^1.1.0"},"peerDependencies":{"postcss":"^8.3"},"_npmOperationalInternal":{"tmp":"tmp/postcss-gradients-interpolation-method_1.0.0_1646428476258_0.8715733301338691","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":1646428476602,"maintainers":[{"name":"romainmenke","email":"romainmenke@gmail.com"},{"name":"alaguna","email":"sombragriselros@gmail.com"},{"name":"jonathantneal","email":"jonathantneal@hotmail.com"}],"_cnpm_publish_time":1646428476602,"dist-tags":{"latest":"6.0.17"}}