{"name":"@csstools/postcss-relative-color-syntax","version":"4.0.9","keywords":["color","postcss-plugin","relative color syntax"],"license":"MIT-0","_id":"@csstools/postcss-relative-color-syntax@4.0.9","maintainers":[{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"alaguna","email":"sombragriselros@gmail.com"},{"name":"romainmenke","email":"romainmenke@gmail.com"}],"contributors":[{"url":"https://antonio.laguna.es","name":"Antonio Laguna","email":"antonio@laguna.es"},{"name":"Romain Menke","email":"romainmenke@gmail.com"}],"homepage":"https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-relative-color-syntax#readme","bugs":{"url":"https://github.com/csstools/postcss-plugins/issues"},"dist":{"shasum":"46decc89a0356f60de58e877b4b18b5b6fa81b2b","tarball":"http://registry-npm.ywwl.com/@csstools/postcss-relative-color-syntax/download/@csstools/postcss-relative-color-syntax-4.0.9.tgz","fileCount":6,"integrity":"sha512-CuLG2I0Psvs2P5lzd/csCX1b1ZNbnjkqRaKGee9hVZZ325YCSn3dbu7zNoRSIjdpb79LHkmHtOQzcWvj/XJYsw==","signatures":[{"sig":"MEUCIQDq6oqjoENLCaTnZEtbQHuketfZKpzBxRvvDPPrVUKoBgIgLu1p/Rm3gak7mUd920WFx3hfpE8BA3qmcKkmu2cN0UU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIDXt3KJV+4x2mHO+E44Cg0irBkE+JYk+kdGKLD4qYfMJAiEA5XaESAf+YzHHagqqyw2aIOqYBmHJkHIokCNCm4ib0Z0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":7516,"size":3140,"noattachment":false,"key":"/@csstools/postcss-relative-color-syntax/-/@csstools/postcss-relative-color-syntax-4.0.9.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":"1ff8ba6278b9bba62a1eb00fe98093e5b0b3b4d0","scripts":{},"_npmUser":{"name":"romainmenke","email":"romainmenke@gmail.com"},"repository":{"url":"git+https://github.com/csstools/postcss-plugins.git","type":"git","directory":"plugins/postcss-relative-color-syntax"},"_npmVersion":"11.13.0","description":"Use the relative color syntax in CSS","directories":{},"_nodeVersion":"26.1.0","dependencies":{"@csstools/utilities":"^3.0.0","@csstools/css-tokenizer":"^4.0.0","@csstools/css-color-parser":"^4.2.1","@csstools/css-parser-algorithms":"^4.0.0","@csstools/postcss-progressive-custom-properties":"^5.1.2"},"_hasShrinkwrap":false,"peerDependencies":{"postcss":"^8.4"},"_npmOperationalInternal":{"tmp":"tmp/postcss-relative-color-syntax_4.0.9_1787673383851_0.6623656781322116","host":"s3://npm-registry-packages-npm-production"},"readme":"# PostCSS Relative Color Syntax [<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-relative-color-syntax --save-dev`\n\n[PostCSS Relative Color Syntax] lets you use the relative color syntax in CSS color functions following [CSS Color Module 5].\n\n```css\n.example {\n\tbackground: oklab(from oklab(54.3% -22.5% -5%) calc(1.0 - l) calc(a * 0.8) b);\n}\n\n/* becomes */\n\n.example {\n\tbackground: rgb(12, 100, 100);\n}\n```\n\n> [!NOTE]\n> We can not dynamically resolve `var()` arguments in relative color syntax, only static values will work.\n\n## Usage\n\nAdd [PostCSS Relative Color Syntax] to your project:\n\n```bash\nnpm install postcss @csstools/postcss-relative-color-syntax --save-dev\n```\n\nUse it as a [PostCSS] plugin:\n\n```js\nconst postcss = require('postcss');\nconst postcssRelativeColorSyntax = require('@csstools/postcss-relative-color-syntax');\n\npostcss([\n\tpostcssRelativeColorSyntax(/* 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\npostcssRelativeColorSyntax({ preserve: true })\n```\n\n```css\n.example {\n\tbackground: oklab(from oklab(54.3% -22.5% -5%) calc(1.0 - l) calc(a * 0.8) b);\n}\n\n/* becomes */\n\n.example {\n\tbackground: rgb(12, 100, 100);\n\tbackground: oklab(from oklab(54.3% -22.5% -5%) calc(1.0 - l) calc(a * 0.8) b);\n}\n```\n\n[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test\n[css-url]: https://cssdb.org/#relative-color-syntax\n[discord]: https://discord.gg/bUadyRwkJS\n[npm-url]: https://www.npmjs.com/package/@csstools/postcss-relative-color-syntax\n\n[PostCSS]: https://github.com/postcss/postcss\n[PostCSS Relative Color Syntax]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-relative-color-syntax\n[CSS Color Module 5]: https://www.w3.org/TR/css-color-5/#relative-colors\n","publish_time":1787673383949,"_cnpm_publish_time":1787673383949,"dist-tags":{"latest":"4.0.17"}}