{"name":"@csstools/postcss-gradients-interpolation-method","version":"1.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@1.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":"b02430214dc32a1d84555ed8555b02df165774dd","tarball":"http://registry-npm.ywwl.com/@csstools/postcss-gradients-interpolation-method/download/@csstools/postcss-gradients-interpolation-method-1.0.1.tgz","fileCount":10,"integrity":"sha512-le4FeJof419FFTocPtKWwuviose/S4Dq2QCIUwxDO8JVliYfhQN2QaXLbOZCWB2+QGpFCxWv/yHRDhRXxisooA==","signatures":[{"sig":"MEYCIQDTgkLRTrp16AzGd6CTf7r2ZEEtlExHJN4Fzl9rbdFdFQIhAKmVuyNsxdyHWoESpAsJeZegmavhv4X9ICsBD+N1o1AE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27354,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJecwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqoKBAAikGG1FlPNCErYbijflYpcgUL14tO8LVqh75kEIes5JBhODG8\r\nRGzOruWkA4adg0RQmOsML/vLYTN7OO0Az6l92ue0JLHGFwj2LKl7CkN6tHlU\r\nX7iPkKJiNX1YB6mOID+dwf4thRBXM9uIKwIlGoF8how+eoRiPTr7UeUcJj3l\r\nwmYuukgS3ZEBNAV1jzWpxoxg9aNOW1/BoRk8578b9J2gRnIUiC2sFwP1zIMa\r\njrSM8Pg65zdrJyFtU7eK2i49ntd+X/1LUeYkuayVhAioe/WbHhyzEEEsvnAo\r\nGJMsli/p1M9PtmiYpbF6/WlF/YwRLJvttlBXfr9l08IvmbiKqanYwI8t5Zb2\r\n+uenD3bUWx3u7KMObdWIW5RJLPNkGlxXlDwFkbGz4tiUBu0J0OUhXSkuit9P\r\nSoHtVPy5Hkm0ZWLYEweBYruegez+x82ETPRbiUt624+N95Ha+izJfB292HCw\r\nuLW/mzrjmCD/43GZRr1TN6MDlIB7fY6hhU02O76Az5w5Mjk5Vqz6UzmZp3KE\r\nbbGuhMUsxXHNyyCAKd//dEZNXApbQQX8RoFXaXouud/VRiSBtpmegzYkv6cB\r\nvdiA0K/khDHeUtMsnjChSTcRIM122ZZdqDxXXPKYu7iFrPqCMINnCiYU7rYJ\r\nLQENUPbbQlYjzClgteTfjOQ/0zmFtew4p20=\r\n=4+St\r\n-----END PGP SIGNATURE-----\r\n","size":7523,"noattachment":false,"key":"/@csstools/postcss-gradients-interpolation-method/-/@csstools/postcss-gradients-interpolation-method-1.0.1.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":"faf9d8efd5a7dcce873ddb22353f20704f756008","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","dependencies":{"postcss-value-parser":"^4.2.0","@csstools/postcss-progressive-custom-properties":"^1.1.0"},"_hasShrinkwrap":false,"peerDependencies":{"postcss":"^8.3"},"_npmOperationalInternal":{"tmp":"tmp/postcss-gradients-interpolation-method_1.0.1_1646651184222_0.22299026138886435","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":1646651184369,"maintainers":[{"name":"romainmenke","email":"romainmenke@gmail.com"},{"name":"alaguna","email":"sombragriselros@gmail.com"},{"name":"jonathantneal","email":"jonathantneal@hotmail.com"}],"_cnpm_publish_time":1646651184369,"dist-tags":{"latest":"6.0.17"}}