{"_id":"@astrouxds/postcss-custom-property-token-fallback","_rev":"11-3eda0bd7e99ce11184582e936bf81da5","name":"@astrouxds/postcss-custom-property-token-fallback","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"@astrouxds/postcss-custom-property-token-fallback","version":"0.0.1","keywords":["postcss","plugin","fallbacks","custom-properties","design-tokens"],"author":{"name":"Rocket Communications Inc"},"license":"ISC","_id":"@astrouxds/postcss-custom-property-token-fallback@0.0.1","maintainers":[{"name":"rocket_micah","email":"micah.jones@rocketcom.com"},{"name":"bkrocket","email":"brian.kiernan@rocketcom.com"},{"name":"dmcalester","email":"duncan@rocketcom.com"},{"name":"rocketmark","email":"mark.cianfrani@rocketcom.com"}],"homepage":"https://github.com/RocketCommunicationsInc/postcss-custom-property-token-fallback#readme","bugs":{"url":"https://github.com/RocketCommunicationsInc/postcss-custom-property-token-fallback/issues"},"dist":{"shasum":"95e3a137c0a0f7c982efb0aecef35b179be8b30d","tarball":"https://registry.npmjs.org/@astrouxds/postcss-custom-property-token-fallback/-/postcss-custom-property-token-fallback-0.0.1.tgz","fileCount":5,"integrity":"sha512-mjIvbOy3+mU2sq02vbKL8se4wpNYlrW1fPHw7NXnMtf6Xf89RXlGNltLjkkf3EtjEMAb2yOieyO86vVQ8GL5vA==","signatures":[{"sig":"MEQCICCRCqTz5q+Ax2arAyW2+SyQpaHN16f0Wkd5VQUTqsbrAiAhe4DlarXMNosWH/LAy05PwnYRlRkraUQ94o/2T4Zesw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5237},"jest":{"coverageThreshold":{"global":{"statements":100}}},"main":"index.js","gitHead":"32f51e431160dada2bb17ce1fa79cca9cf93219d","scripts":{"test":"npx jest"},"_npmUser":{"name":"rocket_micah","email":"micah.jones@rocketcom.com"},"repository":{"url":"git+https://github.com/RocketCommunicationsInc/postcss-custom-property-token-fallback.git","type":"git"},"_npmVersion":"8.5.0","description":"A postcss plugin that adds fallback values to custom properties.","directories":{},"_nodeVersion":"16.14.2","eslintConfig":{"env":{"es6":true,"node":true},"rules":{"jest/expect-expect":"off"},"extends":["eslint:recommended","plugin:jest/recommended"],"parserOptions":{"ecmaVersion":2017}},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","eslint":"^8.0.1","postcss":"^8.3.11","autoprefixer":"^10.4.13","clean-publish":"^3.4.2","eslint-plugin-jest":"^25.2.2","@types/autoprefixer":"^10.2.0"},"peerDependencies":{"postcss":"^8.3.0"},"_npmOperationalInternal":{"tmp":"tmp/postcss-custom-property-token-fallback_0.0.1_1683732605661_0.7600081132702574","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"@astrouxds/postcss-custom-property-token-fallback","version":"0.0.2","keywords":["postcss","plugin","fallbacks","custom-properties","design-tokens"],"author":{"name":"Rocket Communications Inc"},"license":"ISC","_id":"@astrouxds/postcss-custom-property-token-fallback@0.0.2","maintainers":[{"name":"rocket_micah","email":"micah.jones@rocketcom.com"},{"name":"bkrocket","email":"brian.kiernan@rocketcom.com"},{"name":"dmcalester","email":"duncan@rocketcom.com"},{"name":"rocketmark","email":"mark.cianfrani@rocketcom.com"}],"homepage":"https://github.com/RocketCommunicationsInc/postcss-custom-property-token-fallback#readme","bugs":{"url":"https://github.com/RocketCommunicationsInc/postcss-custom-property-token-fallback/issues"},"dist":{"shasum":"a33242970480040ee05b0b2ae7a7aaebf3239e32","tarball":"https://registry.npmjs.org/@astrouxds/postcss-custom-property-token-fallback/-/postcss-custom-property-token-fallback-0.0.2.tgz","fileCount":5,"integrity":"sha512-wQLfbjY8Ohyn7h0E/7FGp+3CnZypTzztNKkFS7y9RN+eXcg6uUyez1Y5oKWabOYj0eNEFj8HMx9uAKVIpGvPNQ==","signatures":[{"sig":"MEYCIQCI4EUtl1ytNhQaXUtzuv8P0U6xD0JIqLywUAOHDt1rrwIhAP6c3XeaojPkc/GEURqVEzjginSCCw0INNqBOzlmgegK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5200},"jest":{"coverageThreshold":{"global":{"statements":100}}},"main":"index.js","gitHead":"32f51e431160dada2bb17ce1fa79cca9cf93219d","scripts":{"test":"npx jest"},"_npmUser":{"name":"rocket_micah","email":"micah.jones@rocketcom.com"},"repository":{"url":"git+https://github.com/RocketCommunicationsInc/postcss-custom-property-token-fallback.git","type":"git"},"_npmVersion":"8.5.0","description":"A postcss plugin that adds fallback values to custom properties.","directories":{},"_nodeVersion":"16.14.2","eslintConfig":{"env":{"es6":true,"node":true},"rules":{"jest/expect-expect":"off"},"extends":["eslint:recommended","plugin:jest/recommended"],"parserOptions":{"ecmaVersion":2017}},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","eslint":"^8.0.1","postcss":"^8.3.11","autoprefixer":"^10.4.13","clean-publish":"^3.4.2","eslint-plugin-jest":"^25.2.2","@types/autoprefixer":"^10.2.0"},"peerDependencies":{"postcss":"^8.3.0"},"_npmOperationalInternal":{"tmp":"tmp/postcss-custom-property-token-fallback_0.0.2_1683735712145_0.45573586431248225","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"@astrouxds/postcss-custom-property-token-fallback","version":"0.0.3","keywords":["postcss","plugin","fallbacks","custom-properties","design-tokens"],"author":{"name":"Rocket Communications Inc"},"license":"ISC","_id":"@astrouxds/postcss-custom-property-token-fallback@0.0.3","maintainers":[{"name":"rocket_micah","email":"micah.jones@rocketcom.com"},{"name":"bkrocket","email":"brian.kiernan@rocketcom.com"},{"name":"dmcalester","email":"duncan@rocketcom.com"},{"name":"rocketmark","email":"mark.cianfrani@rocketcom.com"}],"contributors":[{"url":"https://github.com/markacianfrani","name":"Mark Cianfrani"},{"url":"https://github.com/micahjones13","name":"Micah Jones"}],"homepage":"https://github.com/RocketCommunicationsInc/postcss-custom-property-token-fallback#readme","bugs":{"url":"https://github.com/RocketCommunicationsInc/postcss-custom-property-token-fallback/issues"},"dist":{"shasum":"fde7224f8bbf6a692b5339ade3b368a94e3e6ba1","tarball":"https://registry.npmjs.org/@astrouxds/postcss-custom-property-token-fallback/-/postcss-custom-property-token-fallback-0.0.3.tgz","fileCount":5,"integrity":"sha512-7caFuRBDT/BsMPWzdZF1hz2sLS8my04ngaebAQk6CGG9GYZCzGNh0kxixogXTM8qDCQzCFxEFCAZo78M09E4ZA==","signatures":[{"sig":"MEYCIQDI+G3LYRgYOM2Yb7EuEen1e5pccWHx8Aky0SH2Hl++YQIhAMLcoAJ0PC11Dgs0a4TxEITGULprQt8bh0GP9RthbQJL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5853},"jest":{"coverageThreshold":{"global":{"statements":100}}},"main":"index.js","gitHead":"2c24e4d802a3816222086a3da26fd89d8f6a6650","scripts":{"test":"npx jest"},"_npmUser":{"name":"rocket_micah","email":"micah.jones@rocketcom.com"},"repository":{"url":"git+https://github.com/RocketCommunicationsInc/postcss-custom-property-token-fallback.git","type":"git"},"_npmVersion":"8.5.0","description":"A postcss plugin that adds fallback values to custom properties.","directories":{},"_nodeVersion":"16.14.2","eslintConfig":{"env":{"es6":true,"node":true},"rules":{"jest/expect-expect":"off"},"extends":["eslint:recommended","plugin:jest/recommended"],"parserOptions":{"ecmaVersion":2017}},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","eslint":"^8.0.1","postcss":"^8.3.11","autoprefixer":"^10.4.13","clean-publish":"^3.4.2","eslint-plugin-jest":"^25.2.2","@types/autoprefixer":"^10.2.0"},"peerDependencies":{"postcss":"^8.3.0"},"_npmOperationalInternal":{"tmp":"tmp/postcss-custom-property-token-fallback_0.0.3_1683842602132_0.7675502968553951","host":"s3://npm-registry-packages"}}},"time":{"created":"2023-05-10T15:30:05.586Z","modified":"2026-06-23T21:42:02.717Z","0.0.1":"2023-05-10T15:30:05.843Z","0.0.2":"2023-05-10T16:21:52.314Z","0.0.3":"2023-05-11T22:03:22.330Z"},"bugs":{"url":"https://github.com/RocketCommunicationsInc/postcss-custom-property-token-fallback/issues"},"author":{"name":"Rocket Communications Inc"},"license":"ISC","homepage":"https://github.com/RocketCommunicationsInc/postcss-custom-property-token-fallback#readme","keywords":["postcss","plugin","fallbacks","custom-properties","design-tokens"],"repository":{"url":"git+https://github.com/RocketCommunicationsInc/postcss-custom-property-token-fallback.git","type":"git"},"description":"A postcss plugin that adds fallback values to custom properties.","contributors":[{"url":"https://github.com/markacianfrani","name":"Mark Cianfrani"},{"url":"https://github.com/micahjones13","name":"Micah Jones"}],"maintainers":[{"email":"chrisk@rocketcom.com","name":"ck_rocket"},{"email":"micah.jones@rocketcom.com","name":"rocket_micah"},{"email":"jacob.norton@rocketcom.com","name":"jacob-rocket"},{"email":"frances.morrison@rocketcom.com","name":"rocket_frances"}],"readme":"# @astrouxds/postcss-custom-property-token-fallback\n\n[PostCSS] @astrouxds/postcss-custom-property-token-fallback\n\n[PostCSS]: https://github.com/postcss/postcss\n\n## Examples\n\n### Input Example\n\n```css\n.foo {\n  color: var(--color-text-default);\n}\n```\n\n### Output Example\n\n```css\n.foo {\n  color: var(--color-text-default, #ffffff);\n}\n```\n\n### What it does\n\nThis plugin will search through your CSS and update all custom-properties to have their fallback value included.\nThis fallback value comes from the given index file, which should be an object with all CSS custom property declarations. For example,\n\n```js\n{\n    'foo': '#123456',\n    'bar': '10px',\n    'fi-fo': '5px',\n}\n```\n\nThis plugin also works for instances where multiple CSS custom props are used. For example,\n\n```css\npadding: var(--spacing-1) var(--spacing-2);\nmargin: calc(var(--spacing-1) + var(--spacing-2));\n```\n\nbecomes\n\n```css\npadding: var(--spacing-1, 4px) var(--spacing-2, 8px);\nmargin: calc(var(--spacing-1, 4px) + var(--spacing-2. 8px));\n```\n\nIf a custom property isn't in the index, the custom property will reamin unchanged.\nIf a custom prop is being used with a fallback already, and that fallback doesn't match the value given in the index file, then the custom property value will be overwritten with the value from the index file.\nFor example, if the current CSS looks like:\n\n```css\ncolor: var(--my-color, #ffffff);\n```\n\nand the index file also has a `my-color` custom prop with a different value, such as `#000000`, then the output would be:\n\n```css\ncolor: var(--my-color, #000000);\n```\n\n## Usage\n\n**Step 1:** Install plugin:\n\n```sh\nnpm install --save-dev postcss @astrouxds/postcss-custom-property-token-fallback\n```\n\n**Step 2:** Check you project for existed PostCSS config: `postcss.config.js`\nin the project root, `\"postcss\"` section in `package.json`\nor `postcss` in bundle config.\n\nIf you do not use PostCSS, add it according to [official docs]\nand set this plugin in settings.\n\n**Step 3:** Add the plugin to plugins list:\n\n```diff\nmodule.exports = {\n  plugins: [\n+   require('@astrouxds/postcss-custom-property-token-fallback({index: yourIndexFile })'),\n    require('autoprefixer')\n  ]\n}\n```\n\n[official docs]: https://github.com/postcss/postcss#usage\n","readmeFilename":"README.md"}