{"name":"postcss-color-functional-notation","version":"8.0.2","keywords":["color","comma","css","design","functional","hsl","hsla","hwb","notation","postcss","postcss-plugin","rgb","rgba","space","syntax"],"author":{"name":"Jonathan Neal","email":"jonathantneal@hotmail.com"},"license":"MIT-0","_id":"postcss-color-functional-notation@8.0.2","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-color-functional-notation#readme","bugs":{"url":"https://github.com/csstools/postcss-plugins/issues"},"dist":{"shasum":"53d4c27b6f49ecf4777e1497252825d507bf78eb","tarball":"http://registry-npm.ywwl.com/postcss-color-functional-notation/download/postcss-color-functional-notation-8.0.2.tgz","fileCount":6,"integrity":"sha512-tbmkk6teYpJzFcGwPIhN1gkvxqGHvNx2PMb8Y3S5Ktyn7xOlvD98XzQ99MFY5mAyvXWclDG+BgoJKYJXFJOp5Q==","signatures":[{"sig":"MEUCICaja4EasWw0nIZrvC/HA2EWi4TSAfCBVTVP9ILbNUnuAiEArEC8TvonFKqwTd559MRo756V7WqkTvGpF2vD0rAV/6s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8507,"size":3223,"noattachment":false,"key":"/postcss-color-functional-notation/-/postcss-color-functional-notation-8.0.2.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":"baaef4e0356091eb97dbc64f0767c87fb48bf1fc","scripts":{},"_npmUser":{"name":"romainmenke","email":"romainmenke@gmail.com"},"repository":{"url":"git+https://github.com/csstools/postcss-plugins.git","type":"git","directory":"plugins/postcss-color-functional-notation"},"_npmVersion":"11.6.2","description":"Use space and slash separated color notation 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.2","@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-color-functional-notation_8.0.2_1771686481149_0.7040612703034554","host":"s3://npm-registry-packages-npm-production"},"readme":"# PostCSS Color Functional Notation [<img src=\"https://postcss.github.io/postcss/logo.svg\" alt=\"PostCSS Logo\" width=\"90\" height=\"90\" align=\"right\">][PostCSS]\n\n`npm install postcss-color-functional-notation --save-dev`\n\n[PostCSS Color Functional Notation] lets you use space and slash separated\ncolor notation in CSS, following the [CSS Color] specification.\n\n```css\n:root {\n\t--firebrick: rgb(178 34 34);\n\t--firebrick-a50: rgb(70% 13.5% 13.5% / 50%);\n\t--firebrick-hsl: hsla(0 68% 42%);\n\t--firebrick-hsl-a50: hsl(0 68% 42% / 50%);\n}\n\n/* becomes */\n\n:root {\n\t--firebrick: rgb(178, 34, 34);\n\t--firebrick-a50: rgba(179, 34, 34, 0.5);\n\t--firebrick-hsl: hsl(0, 68%, 42%);\n\t--firebrick-hsl-a50: hsla(0, 68%, 42%, 0.5);\n}\n```\n\n## Usage\n\nAdd [PostCSS Color Functional Notation] to your project:\n\n```bash\nnpm install postcss postcss-color-functional-notation --save-dev\n```\n\nUse it as a [PostCSS] plugin:\n\n```js\nconst postcss = require('postcss');\nconst postcssColorFunctionalNotation = require('postcss-color-functional-notation');\n\npostcss([\n\tpostcssColorFunctionalNotation(/* 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\npostcssColorFunctionalNotation({ preserve: true })\n```\n\n```css\n:root {\n\t--firebrick: rgb(178 34 34);\n\t--firebrick-a50: rgb(70% 13.5% 13.5% / 50%);\n\t--firebrick-hsl: hsla(0 68% 42%);\n\t--firebrick-hsl-a50: hsl(0 68% 42% / 50%);\n}\n\n/* becomes */\n\n:root {\n\t--firebrick: rgb(178, 34, 34);\n\t--firebrick-a50: rgba(179, 34, 34, 0.5);\n\t--firebrick-hsl: hsl(0, 68%, 42%);\n\t--firebrick-hsl: hsla(0 68% 42%);\n\t--firebrick-hsl-a50: hsla(0, 68%, 42%, 0.5);\n}\n\n@supports (color: rgb(0 0 0 / 0)) {\n:root {\n\t--firebrick: rgb(178 34 34);\n\t--firebrick-a50: rgb(70% 13.5% 13.5% / 50%);\n}\n}\n\n@supports (color: hsl(0 0% 0% / 0)) {\n:root {\n\t--firebrick-hsl-a50: hsl(0 68% 42% / 50%);\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\npostcssColorFunctionalNotation({ enableProgressiveCustomProperties: false })\n```\n\n```css\n:root {\n\t--firebrick: rgb(178 34 34);\n\t--firebrick-a50: rgb(70% 13.5% 13.5% / 50%);\n\t--firebrick-hsl: hsla(0 68% 42%);\n\t--firebrick-hsl-a50: hsl(0 68% 42% / 50%);\n}\n\n/* becomes */\n\n:root {\n\t--firebrick: rgb(178, 34, 34);\n\t--firebrick: rgb(178 34 34);\n\t--firebrick-a50: rgba(179, 34, 34, 0.5);\n\t--firebrick-a50: rgb(70% 13.5% 13.5% / 50%);\n\t--firebrick-hsl: hsl(0, 68%, 42%);\n\t--firebrick-hsl: hsla(0 68% 42%);\n\t--firebrick-hsl-a50: hsla(0, 68%, 42%, 0.5);\n\t--firebrick-hsl-a50: hsl(0 68% 42% / 50%);\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/#color-functional-notation\n[discord]: https://discord.gg/bUadyRwkJS\n[npm-url]: https://www.npmjs.com/package/postcss-color-functional-notation\n\n[PostCSS]: https://github.com/postcss/postcss\n[PostCSS Color Functional Notation]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-functional-notation\n[CSS Color]: https://www.w3.org/TR/css-color-4/#funcdef-rgb\n","publish_time":1771686481294,"_cnpm_publish_time":1771686481294,"dist-tags":{"latest":"8.0.17"}}