{"name":"postcss-lab-function","version":"8.0.7","keywords":["color","comma","css","design","functional","lab","lch","notation","postcss","postcss-plugin","rgb","rgba","space","syntax"],"author":{"name":"Jonathan Neal","email":"jonathantneal@hotmail.com"},"license":"MIT-0","_id":"postcss-lab-function@8.0.7","maintainers":[{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"alaguna","email":"sombragriselros@gmail.com"},{"name":"romainmenke","email":"romainmenke@gmail.com"}],"homepage":"https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-lab-function#readme","bugs":{"url":"https://github.com/csstools/postcss-plugins/issues"},"dist":{"shasum":"5fcade96cdfe00635a891c01631a663cfc01bddc","tarball":"http://registry-npm.ywwl.com/postcss-lab-function/download/postcss-lab-function-8.0.7.tgz","fileCount":6,"integrity":"sha512-15K/TiwaN3xdIxxaex7pqOIzvaRHcqm1DTiDVxmEJ29jpUztUYJA+O5m/GT9X9UODgqnsXHe46Ca4x+V4LFwcw==","signatures":[{"sig":"MEUCIEoQElwMx5jcd7RfHZIy6Rdzct7PF6o41LlNQcBWimKgAiEAiopqiI5s2DvY34QFjl/hwA9nCR2GjPhR+hh9knpDqRw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9582,"size":3836,"noattachment":false,"key":"/postcss-lab-function/-/postcss-lab-function-8.0.7.tgz"},"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":"c9c28beb6a67f54cd10b3e62f1e339792da4a0bd","scripts":{},"_npmUser":{"name":"romainmenke","email":"romainmenke@gmail.com"},"repository":{"url":"git+https://github.com/csstools/postcss-plugins.git","type":"git","directory":"plugins/postcss-lab-function"},"_npmVersion":"11.13.0","description":"Use lab() and lch() color functions in CSS","directories":{},"_nodeVersion":"26.1.0","dependencies":{"@csstools/utilities":"^3.0.0","@csstools/css-tokenizer":"^4.0.0","@csstools/css-color-parser":"^4.1.10","@csstools/css-parser-algorithms":"^4.0.0","@csstools/postcss-progressive-custom-properties":"^5.1.1"},"_hasShrinkwrap":false,"peerDependencies":{"postcss":"^8.4"},"_npmOperationalInternal":{"tmp":"tmp/postcss-lab-function_8.0.7_1784737544872_0.3637035413398251","host":"s3://npm-registry-packages-npm-production"},"readme":"# PostCSS Lab Function [<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/postcss-lab-function.svg\" height=\"20\">][npm-url]\n[<img alt=\"Build Status\" src=\"https://github.com/csstools/postcss-plugins/actions/workflows/test.yml/badge.svg?branch=main\" height=\"20\">][cli-url]\n[<img alt=\"Discord\" src=\"https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white\">][discord]\n<br><br>\n[<img alt=\"Baseline Status\" src=\"https://cssdb.org/images/badges-baseline/lab-function.svg\" height=\"20\">][css-url]\n[<img alt=\"CSS Standard Status\" src=\"https://cssdb.org/images/badges/lab-function.svg\" height=\"20\">][css-url]\n\n[PostCSS Lab Function] lets you use `lab` and `lch` color functions in\nCSS, following the [CSS Color] specification.\n\n```css\n.color-lab {\n\tcolor: lab(40% 56.6 39);\n}\n\n.color-lch {\n\tcolor: lch(40% 68.735435 34.568626);\n}\n\n/* becomes */\n\n.color {\n\tcolor: rgb(179, 35, 35);\n\tcolor: color(display-p3 0.64331 0.19245 0.16771);\n}\n\n.color-lch {\n\tcolor: rgb(179, 35, 35);\n\tcolor: color(display-p3 0.64331 0.19245 0.16771);\n}\n```\n\n## Usage\n\nAdd [PostCSS Lab Function] to your project:\n\n```bash\nnpm install postcss postcss-lab-function --save-dev\n```\n\nUse it as a [PostCSS] plugin:\n\n```js\nconst postcss = require('postcss');\nconst postcssLabFunction = require('postcss-lab-function');\n\npostcss([\n  postcssLabFunction(/* pluginOptions */)\n]).process(YOUR_CSS /*, processOptions */);\n```\n\n[PostCSS Lab Function] runs in all Node environments, with special\ninstructions for:\n\n| [Node](INSTALL.md#node) | [PostCSS CLI](INSTALL.md#postcss-cli) | [Webpack](INSTALL.md#webpack) | [Gulp](INSTALL.md#gulp) | [Grunt](INSTALL.md#grunt) |\n| --- | --- | --- | --- | --- |\n\n## Options\n\n### preserve\n\nThe `preserve` option determines whether the original functional color notation\nis preserved. By default, it is not preserved.\n\n```js\npostcssLabFunction({ preserve: true })\n```\n\n```css\n.color {\n\tcolor: lab(40% 56.6 39);\n}\n\n/* becomes */\n\n.color {\n\tcolor: rgb(179, 35, 35);\n\tcolor: color(display-p3 0.64331 0.19245 0.16771);\n\tcolor: lab(40% 56.6 39);\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\npostcssLabFunction({ enableProgressiveCustomProperties: false })\n```\n\n```css\n:root {\n\t--firebrick: lab(40% 56.6 39);\n}\n\n/* becomes */\n\n:root {\n\t--firebrick: rgb(178, 34, 34); /* will never be used, not even in older browser */\n\t--firebrick: color(display-p3 0.64331 0.19245 0.16771); /* will never be used, not even in older browser */\n\t--firebrick: lab(40% 56.6 39);\n}\n```\n\n### subFeatures\n\n#### displayP3\n\nThe `subFeatures.displayP3` option determines if `color(display-p3 ...)` is used as a fallback.<br>\nBy default, it is enabled.\n\n`display-p3` can display wider gamut colors than `rgb` on some devices.\n\n```js\npostcssOKLabFunction({\n\tsubFeatures: {\n\t\tdisplayP3: false\n\t}\n})\n```\n\n```css\n.color {\n\tcolor: lab(40% 56.6 39);\n}\n\n/* becomes */\n\n.color {\n\tcolor: rgb(179, 35, 35);\n\tcolor: lab(40% 56.6 39);\n}\n```\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/#lab-function\n[discord]: https://discord.gg/bUadyRwkJS\n[npm-url]: https://www.npmjs.com/package/postcss-lab-function\n\n[CSS Color]: https://drafts.csswg.org/css-color/#specifying-lab-lch\n[Gulp PostCSS]: https://github.com/postcss/gulp-postcss\n[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss\n[PostCSS]: https://github.com/postcss/postcss\n[PostCSS Loader]: https://github.com/postcss/postcss-loader\n[PostCSS Lab Function]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-lab-function\n","publish_time":1784737545000,"_cnpm_publish_time":1784737545000,"dist-tags":{"latest":"8.0.17"}}