{"_id":"@csstools/postcss-alpha-function","_rev":"4266195","name":"@csstools/postcss-alpha-function","description":"Use the alpha() function in CSS","dist-tags":{"latest":"2.0.3"},"maintainers":[{"name":"alaguna","email":"a.laguna@funcion13.com"},{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"romainmenke","email":""}],"time":{"modified":"2026-04-06T16:28:43.000Z","created":"2025-08-22T19:44:50.810Z","2.0.3":"2026-02-21T15:07:42.998Z","2.0.2":"2026-01-25T13:04:32.335Z","2.0.1":"2026-01-15T14:04:34.843Z","2.0.0":"2026-01-14T07:35:52.047Z","1.0.1":"2025-09-21T14:36:27.224Z","1.0.0":"2025-08-22T19:44:50.810Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/csstools/postcss-plugins.git","directory":"plugins/postcss-alpha-function"},"versions":{"2.0.3":{"name":"@csstools/postcss-alpha-function","description":"Use the alpha() function in CSS","version":"2.0.3","contributors":[{"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-color-parser":"^4.0.2","@csstools/css-parser-algorithms":"^4.0.0","@csstools/css-tokenizer":"^4.0.0","@csstools/postcss-progressive-custom-properties":"^5.0.0","@csstools/utilities":"^3.0.0"},"peerDependencies":{"postcss":"^8.4"},"scripts":{},"homepage":"https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-alpha-function#readme","repository":{"type":"git","url":"git+https://github.com/csstools/postcss-plugins.git","directory":"plugins/postcss-alpha-function"},"bugs":{"url":"https://github.com/csstools/postcss-plugins/issues"},"keywords":["alpha","color","css","design","postcss","postcss-plugin"],"gitHead":"ca199f9ac95cb1a21b599aead5eb8ceda849c94c","_id":"@csstools/postcss-alpha-function@2.0.3","_nodeVersion":"25.1.0","_npmVersion":"11.6.2","dist":{"shasum":"cf7f1cfd98ec7b312813d01bb8e5b108327ed88c","size":3758,"noattachment":false,"key":"/@csstools/postcss-alpha-function/-/@csstools/postcss-alpha-function-2.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/@csstools/postcss-alpha-function/download/@csstools/postcss-alpha-function-2.0.3.tgz"},"_npmUser":{"name":"romainmenke","email":"romainmenke@gmail.com"},"directories":{},"maintainers":[{"name":"alaguna","email":"a.laguna@funcion13.com"},{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"romainmenke","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/postcss-alpha-function_2.0.3_1771686462857_0.2935580607228967"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-02-21T15:07:42.998Z","publish_time":1771686462998,"_source_registry_name":"default","_cnpm_publish_time":1771686462998},"2.0.2":{"name":"@csstools/postcss-alpha-function","description":"Use the alpha() function in CSS","version":"2.0.2","contributors":[{"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-color-parser":"^4.0.1","@csstools/css-parser-algorithms":"^4.0.0","@csstools/css-tokenizer":"^4.0.0","@csstools/postcss-progressive-custom-properties":"^5.0.0","@csstools/utilities":"^3.0.0"},"peerDependencies":{"postcss":"^8.4"},"scripts":{},"homepage":"https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-alpha-function#readme","repository":{"type":"git","url":"git+https://github.com/csstools/postcss-plugins.git","directory":"plugins/postcss-alpha-function"},"bugs":{"url":"https://github.com/csstools/postcss-plugins/issues"},"keywords":["alpha","color","css","design","postcss","postcss-plugin"],"gitHead":"219dbe1dcbcd4d76c6dd23d85ab17a1764950736","_id":"@csstools/postcss-alpha-function@2.0.2","_nodeVersion":"25.1.0","_npmVersion":"11.6.2","dist":{"shasum":"74ac78ae10daf06be144bbebfb919220d0443127","size":3752,"noattachment":false,"key":"/@csstools/postcss-alpha-function/-/@csstools/postcss-alpha-function-2.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/@csstools/postcss-alpha-function/download/@csstools/postcss-alpha-function-2.0.2.tgz"},"_npmUser":{"name":"romainmenke","email":"romainmenke@gmail.com"},"directories":{},"maintainers":[{"name":"alaguna","email":"a.laguna@funcion13.com"},{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"romainmenke","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/postcss-alpha-function_2.0.2_1769346272194_0.13450715028812232"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-01-25T13:04:32.335Z","publish_time":1769346272335,"_source_registry_name":"default","_cnpm_publish_time":1769346272335},"2.0.1":{"name":"@csstools/postcss-alpha-function","description":"Use the alpha() function in CSS","version":"2.0.1","contributors":[{"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-color-parser":"^4.0.0","@csstools/css-parser-algorithms":"^4.0.0","@csstools/css-tokenizer":"^4.0.0","@csstools/postcss-progressive-custom-properties":"^5.0.0","@csstools/utilities":"^3.0.0"},"peerDependencies":{"postcss":"^8.4"},"scripts":{},"homepage":"https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-alpha-function#readme","repository":{"type":"git","url":"git+https://github.com/csstools/postcss-plugins.git","directory":"plugins/postcss-alpha-function"},"bugs":{"url":"https://github.com/csstools/postcss-plugins/issues"},"keywords":["alpha","color","css","design","postcss","postcss-plugin"],"gitHead":"0c784a35ede967a095300930ce36423bb7cea323","_id":"@csstools/postcss-alpha-function@2.0.1","_nodeVersion":"25.1.0","_npmVersion":"11.6.2","dist":{"shasum":"862c7c2c517efbbdd7f9e914fd42f47fcb39491e","size":3737,"noattachment":false,"key":"/@csstools/postcss-alpha-function/-/@csstools/postcss-alpha-function-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@csstools/postcss-alpha-function/download/@csstools/postcss-alpha-function-2.0.1.tgz"},"_npmUser":{"name":"romainmenke","email":"romainmenke@gmail.com"},"directories":{},"maintainers":[{"name":"alaguna","email":"a.laguna@funcion13.com"},{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"romainmenke","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/postcss-alpha-function_2.0.1_1768485874700_0.4431808312394925"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-01-15T14:04:34.843Z","publish_time":1768485874843,"_source_registry_name":"default","_cnpm_publish_time":1768485874843},"2.0.0":{"name":"@csstools/postcss-alpha-function","description":"Use the alpha() function in CSS","version":"2.0.0","contributors":[{"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-color-parser":"^4.0.0","@csstools/css-parser-algorithms":"^4.0.0","@csstools/css-tokenizer":"^4.0.0","@csstools/postcss-progressive-custom-properties":"^5.0.0","@csstools/utilities":"^3.0.0"},"peerDependencies":{"postcss":"^8.4"},"scripts":{},"homepage":"https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-alpha-function#readme","repository":{"type":"git","url":"git+https://github.com/csstools/postcss-plugins.git","directory":"plugins/postcss-alpha-function"},"bugs":{"url":"https://github.com/csstools/postcss-plugins/issues"},"keywords":["alpha","color","css","design","postcss","postcss-plugin"],"gitHead":"e82e58fbb15702d23eca7458edf0a14cbbbe7f7a","_id":"@csstools/postcss-alpha-function@2.0.0","_nodeVersion":"25.1.0","_npmVersion":"11.6.2","dist":{"shasum":"08e1de44eb3451a75ae9939d45afa179882df8ec","size":3933,"noattachment":false,"key":"/@csstools/postcss-alpha-function/-/@csstools/postcss-alpha-function-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@csstools/postcss-alpha-function/download/@csstools/postcss-alpha-function-2.0.0.tgz"},"_npmUser":{"name":"romainmenke","email":"romainmenke@gmail.com"},"directories":{},"maintainers":[{"name":"alaguna","email":"a.laguna@funcion13.com"},{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"romainmenke","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/postcss-alpha-function_2.0.0_1768376151904_0.6597151907891043"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-01-14T07:35:52.047Z","publish_time":1768376152047,"_source_registry_name":"default","_cnpm_publish_time":1768376152047},"1.0.1":{"name":"@csstools/postcss-alpha-function","description":"Use the alpha() function in CSS","version":"1.0.1","contributors":[{"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":">=18"},"type":"module","main":"dist/index.cjs","module":"dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"},"require":{"default":"./dist/index.cjs"}}},"dependencies":{"@csstools/css-color-parser":"^3.1.0","@csstools/css-parser-algorithms":"^3.0.5","@csstools/css-tokenizer":"^3.0.4","@csstools/postcss-progressive-custom-properties":"^4.2.1","@csstools/utilities":"^2.0.0"},"peerDependencies":{"postcss":"^8.4"},"scripts":{},"homepage":"https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-alpha-function#readme","repository":{"type":"git","url":"git+https://github.com/csstools/postcss-plugins.git","directory":"plugins/postcss-alpha-function"},"bugs":{"url":"https://github.com/csstools/postcss-plugins/issues"},"keywords":["alpha","color","css","design","postcss","postcss-plugin"],"_id":"@csstools/postcss-alpha-function@1.0.1","gitHead":"fc8c96d47a9c96dea921c90d786bde7f261e8fad","types":"./dist/index.d.ts","_nodeVersion":"24.4.0","_npmVersion":"11.4.2","dist":{"shasum":"7989605711de7831bc7cd75b94c9b5bac9c3728e","size":4307,"noattachment":false,"key":"/@csstools/postcss-alpha-function/-/@csstools/postcss-alpha-function-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@csstools/postcss-alpha-function/download/@csstools/postcss-alpha-function-1.0.1.tgz"},"_npmUser":{"name":"romainmenke","email":"romainmenke@gmail.com"},"directories":{},"maintainers":[{"name":"alaguna","email":"a.laguna@funcion13.com"},{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"romainmenke","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/postcss-alpha-function_1.0.1_1758465386959_0.35048730906107917"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-09-21T14:36:27.224Z","publish_time":1758465387224,"_source_registry_name":"default","_cnpm_publish_time":1758465387224},"1.0.0":{"name":"@csstools/postcss-alpha-function","description":"Use the alpha() function in CSS","version":"1.0.0","contributors":[{"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":">=18"},"type":"module","main":"dist/index.cjs","module":"dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"},"require":{"default":"./dist/index.cjs"}}},"dependencies":{"@csstools/css-color-parser":"^3.1.0","@csstools/css-parser-algorithms":"^3.0.5","@csstools/css-tokenizer":"^3.0.4","@csstools/postcss-progressive-custom-properties":"^4.2.0","@csstools/utilities":"^2.0.0"},"peerDependencies":{"postcss":"^8.4"},"scripts":{},"homepage":"https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-alpha-function#readme","repository":{"type":"git","url":"git+https://github.com/csstools/postcss-plugins.git","directory":"plugins/postcss-alpha-function"},"bugs":{"url":"https://github.com/csstools/postcss-plugins/issues"},"keywords":["alpha","color","css","design","postcss","postcss-plugin"],"_id":"@csstools/postcss-alpha-function@1.0.0","gitHead":"fca7b4f89596801d44669f71cff1a49a2d9e39c0","types":"./dist/index.d.ts","_nodeVersion":"24.4.0","_npmVersion":"11.4.2","dist":{"shasum":"8764fbbf25a5f1e106fb623ae632e01a220a6fc2","size":4327,"noattachment":false,"key":"/@csstools/postcss-alpha-function/-/@csstools/postcss-alpha-function-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@csstools/postcss-alpha-function/download/@csstools/postcss-alpha-function-1.0.0.tgz"},"_npmUser":{"name":"romainmenke","email":"romainmenke@gmail.com"},"directories":{},"maintainers":[{"name":"alaguna","email":"a.laguna@funcion13.com"},{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"romainmenke","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/postcss-alpha-function_1.0.0_1755891890599_0.6988256144147242"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-08-22T19:44:50.810Z","publish_time":1755891890810,"_source_registry_name":"default","_cnpm_publish_time":1755891890810}},"readme":"# PostCSS Alpha 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-alpha-function --save-dev`\n\n[PostCSS Alpha Function] lets you use the `alpha` function in\nCSS, following the [CSS Color] specification.\n\n```css\n.color {\n\tcolor: alpha(from #dddd / calc(alpha / 2));\n}\n\n:root {\n\t--a-color: alpha(from rgb(2 1 0 / var(--a)) / calc(alpha / 2));\n}\n\n/* becomes */\n\n.color {\n\tcolor: rgb(from #dddd r g b / calc(alpha / 2));\n}\n\n:root {\n\t--a-color: rgb(from rgb(2 1 0 / var(--a)) r g b / calc(alpha / 2));\n}\n```\n\n## Usage\n\nAdd [PostCSS Alpha Function] to your project:\n\n```bash\nnpm install postcss @csstools/postcss-alpha-function --save-dev\n```\n\nUse it as a [PostCSS] plugin:\n\n```js\nconst postcss = require('postcss');\nconst postcssAlphaFunction = require('@csstools/postcss-alpha-function');\n\npostcss([\n\tpostcssAlphaFunction(/* 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\npostcssAlphaFunction({ preserve: true })\n```\n\n```css\n.color {\n\tcolor: alpha(from #dddd / calc(alpha / 2));\n}\n\n:root {\n\t--a-color: alpha(from rgb(2 1 0 / var(--a)) / calc(alpha / 2));\n}\n\n/* becomes */\n\n.color {\n\tcolor: rgb(from #dddd r g b / calc(alpha / 2));\n\tcolor: alpha(from #dddd / calc(alpha / 2));\n}\n\n:root {\n\t--a-color: rgb(from rgb(2 1 0 / var(--a)) r g b / calc(alpha / 2));\n}\n\n@supports (color: alpha(from red / 1)) and (color: rgb(0 0 0 / 0)) {\n:root {\n\t--a-color: alpha(from rgb(2 1 0 / var(--a)) / calc(alpha / 2));\n}\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\npostcssAlphaFunction({ enableProgressiveCustomProperties: false })\n```\n\n```css\n.color {\n\tcolor: alpha(from #dddd / calc(alpha / 2));\n}\n\n:root {\n\t--a-color: alpha(from rgb(2 1 0 / var(--a)) / calc(alpha / 2));\n}\n\n/* becomes */\n\n.color {\n\tcolor: rgb(from #dddd r g b / calc(alpha / 2));\n\tcolor: alpha(from #dddd / calc(alpha / 2));\n}\n\n:root {\n\t--a-color: rgb(from rgb(2 1 0 / var(--a)) r g b / calc(alpha / 2));\n\t--a-color: alpha(from rgb(2 1 0 / var(--a)) / calc(alpha / 2));\n}\n```\n\n_Custom properties do not fallback to the previous declaration_\n\n## Copyright : color conversions\n\nThis software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/tree/main/css-color-4. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang).\n\n[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test\n[css-url]: https://cssdb.org/#alpha-function\n[discord]: https://discord.gg/bUadyRwkJS\n[npm-url]: https://www.npmjs.com/package/@csstools/postcss-alpha-function\n\n[PostCSS]: https://github.com/postcss/postcss\n[PostCSS Alpha Function]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-alpha-function\n[CSS Color]: https://drafts.csswg.org/css-color-5/#relative-alpha\n","_attachments":{},"homepage":"https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-alpha-function#readme","bugs":{"url":"https://github.com/csstools/postcss-plugins/issues"},"license":"MIT-0"}