{"name":"@csstools/postcss-oklab-function","version":"5.0.1","keywords":["color","css","design","display-p3","oklab","oklch","postcss","postcss-plugin","syntax"],"author":{"name":"Jonathan Neal","email":"jonathantneal@hotmail.com"},"license":"MIT-0","_id":"@csstools/postcss-oklab-function@5.0.1","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-oklab-function#readme","bugs":{"url":"https://github.com/csstools/postcss-plugins/issues"},"dist":{"shasum":"0e1731dd10c69444c4646748d8d5c302bdd4b96f","tarball":"http://registry-npm.ywwl.com/@csstools/postcss-oklab-function/download/@csstools/postcss-oklab-function-5.0.1.tgz","fileCount":6,"integrity":"sha512-Ql+X4zu29ITihxHKcCFEU84ww+Nkv44M2s0fT7Nv4iQYlQ4+liF6v9RL0ezeogeiLRNLLC6yh0ay1PHpmaNIgQ==","signatures":[{"sig":"MEUCIQCxdOzVpyPXMOaFcubxwkWDCTEQeGzxWqAY2PoDdJnmrgIgLhgPXWHIX+GRXttWyWq/fFSK2GbQtHp3y6N8qhF3XQU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9983,"size":3862,"noattachment":false,"key":"/@csstools/postcss-oklab-function/-/@csstools/postcss-oklab-function-5.0.1.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":"8949422ea134bd02ee4482d74b32ca7c17f5fb61","scripts":{},"_npmUser":{"name":"romainmenke","email":"romainmenke@gmail.com"},"repository":{"url":"git+https://github.com/csstools/postcss-plugins.git","type":"git","directory":"plugins/postcss-oklab-function"},"_npmVersion":"11.6.2","description":"Use oklab() and oklch() color functions in CSS","directories":{},"_nodeVersion":"25.1.0","dependencies":{"@csstools/utilities":"^3.0.0","@csstools/css-tokenizer":"^4.0.0","@csstools/css-color-parser":"^4.0.1","@csstools/css-parser-algorithms":"^4.0.0","@csstools/postcss-progressive-custom-properties":"^5.0.0"},"_hasShrinkwrap":false,"peerDependencies":{"postcss":"^8.4"},"_npmOperationalInternal":{"tmp":"tmp/postcss-oklab-function_5.0.1_1769346342320_0.030824983809263795","host":"s3://npm-registry-packages-npm-production"},"readme":"# PostCSS OKLab 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/@csstools/postcss-oklab-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/oklab-function.svg\" height=\"20\">][css-url]\n[<img alt=\"CSS Standard Status\" src=\"https://cssdb.org/images/badges/oklab-function.svg\" height=\"20\">][css-url]\n\n[PostCSS OKLab Function] lets you use `oklab` and `oklch` color functions in\nCSS, following the [CSS Color] specification.\n\n```css\n.test-oklab {\n\tcolor: oklab(40% 0.001236 0.0039);\n}\n\n.test-oklch {\n\tcolor: oklch(40% 0.268735435 34.568626);\n}\n\n/* becomes */\n\n.test-oklab {\n\tcolor: rgb(73, 71, 69);\n\tcolor: color(display-p3 0.28515 0.27983 0.27246);\n}\n\n.test-oklch {\n\tcolor: rgb(131, 28, 0);\n\tcolor: color(display-p3 0.49163 0.11178 0.00000);\n}\n```\n\n## Usage\n\nAdd [PostCSS OKLab Function] to your project:\n\n```bash\nnpm install postcss @csstools/postcss-oklab-function --save-dev\n```\n\nUse it as a [PostCSS] plugin:\n\n```js\nconst postcss = require('postcss');\nconst postcssOKLabFunction = require('@csstools/postcss-oklab-function');\n\npostcss([\n  postcssOKLabFunction(/* pluginOptions */)\n]).process(YOUR_CSS /*, processOptions */);\n```\n\n[PostCSS OKLab 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 notation\nis preserved. By default, it is not preserved.\n\n```js\npostcssOKLabFunction({ preserve: true })\n```\n\n```css\n.test-oklab {\n\tcolor: oklab(40% 0.001236 0.0039);\n}\n\n.test-oklch {\n\tcolor: oklch(40% 0.268735435 34.568626);\n}\n\n/* becomes */\n\n.test-oklab {\n\tcolor: rgb(73, 71, 69);\n\tcolor: color(display-p3 0.28515 0.27983 0.27246);\n\tcolor: oklab(40% 0.001236 0.0039);\n}\n\n.test-oklch {\n\tcolor: rgb(131, 28, 0);\n\tcolor: color(display-p3 0.49163 0.11178 0.00000);\n\tcolor: oklch(40% 0.268735435 34.568626);\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\npostcssOKLabFunction({ enableProgressiveCustomProperties: false })\n```\n\n```css\n:root {\n\t--firebrick: oklab(40% 0.234 0.39);\n}\n\n/* becomes */\n\n:root {\n\t--firebrick: rgb(133, 0, 67); /* will never be used, not even in older browser */\n\t--firebrick: color(display-p3 0.49890 0.00000 0.25954); /* will never be used, not even in older browser */\n\t--firebrick: oklab(40% 0.234 0.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.test-oklab {\n\tcolor: oklab(40% 0.001236 0.0039);\n}\n\n.test-oklch {\n\tcolor: oklch(40% 0.268735435 34.568626);\n}\n\n/* becomes */\n\n.test-oklab {\n\tcolor: rgb(73, 71, 69);\n}\n\n.test-oklch {\n\tcolor: rgb(131, 28, 0);\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/#oklab-function\n[discord]: https://discord.gg/bUadyRwkJS\n[npm-url]: https://www.npmjs.com/package/@csstools/postcss-oklab-function\n\n[CSS Color]: https://www.w3.org/TR/css-color-4/#specifying-oklab-oklch\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 OKLab Function]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-oklab-function\n","publish_time":1769346342539,"_cnpm_publish_time":1769346342539,"dist-tags":{"latest":"5.0.17"}}