{"id":41976230,"url":"https://github.com/kelvindecosta/postcss-transform-variables","last_synced_at":"2026-01-25T23:31:05.262Z","repository":{"id":57749368,"uuid":"524499556","full_name":"kelvindecosta/postcss-transform-variables","owner":"kelvindecosta","description":":electric_plug: PostCSS plugin that transforms identifiers of CSS custom properties.","archived":false,"fork":false,"pushed_at":"2022-12-01T09:06:40.000Z","size":90,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-13T04:52:29.356Z","etag":null,"topics":["css","css-variables","custom-properties","obfuscation","postcss","postcss-plugin","transformer"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kelvindecosta.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-13T20:20:39.000Z","updated_at":"2023-03-05T08:55:05.000Z","dependencies_parsed_at":"2023-01-22T23:00:48.179Z","dependency_job_id":null,"html_url":"https://github.com/kelvindecosta/postcss-transform-variables","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/kelvindecosta/postcss-transform-variables","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kelvindecosta%2Fpostcss-transform-variables","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kelvindecosta%2Fpostcss-transform-variables/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kelvindecosta%2Fpostcss-transform-variables/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kelvindecosta%2Fpostcss-transform-variables/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kelvindecosta","download_url":"https://codeload.github.com/kelvindecosta/postcss-transform-variables/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kelvindecosta%2Fpostcss-transform-variables/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28761814,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T23:06:19.311Z","status":"ssl_error","status_checked_at":"2026-01-25T23:03:50.555Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","css-variables","custom-properties","obfuscation","postcss","postcss-plugin","transformer"],"created_at":"2026-01-25T23:31:05.179Z","updated_at":"2026-01-25T23:31:05.244Z","avatar_url":"https://github.com/kelvindecosta.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# postcss-transform-variables\n\n[![GitHub package.json version](https://img.shields.io/github/package-json/v/kelvindecosta/postcss-transform-variables)](https://github.com/postcss/postcss-transform-variables/blob/master/CHANGELOG.md)\n[![PostCSS Compatibility](https://img.shields.io/npm/dependency-version/postcss-transform-variables/peer/postcss)](https://postcss.org/)\n[![Tests](https://github.com/kelvindecosta/postcss-transform-variables/actions/workflows/ci.yml/badge.svg)](https://github.com/kelvindecosta/postcss-transform-variables/actions/workflows/ci.yml)\n[![License](https://img.shields.io/github/license/kelvindecosta/postcss-transform-variables)](https://github.com/kelvindecosta/postcss-transform-variables/blob/main/LICENSE)\n\n[PostCSS] plugin that transforms identifiers of [CSS custom properties](https://developer.mozilla.org/en-US/docs/Web/CSS/--*).\n\n[postcss]: https://github.com/postcss/postcss\n\n## Example\n\n```diff\n :root {\n+  --kd-padding-y: 2px;\n+  --kd-padding-x: 4px;\n-  --padding-y: 2px;\n-  --padding-x: 4px;\n }\n\n p {\n+  padding-block: var(--kd-padding-y) var(--kd-padding-x);\n-  padding-block: var(--padding-y) var(--padding-x);\n }\n```\n\n## Installation\n\n```bash\n# NPM\nnpm i -D postcss-transform-variables\n\n# Yarn\nyarn i -D postcss-transform-variables\n\n# pnpm\npnpm i -D postcss-transform-variables\n```\n\n## Usage\n\nInclude `postcss-transform-variables` in the PostCSS configuration (eg: `postcss.config.js`).\n\n```js\nmodule.exports = {\n  plugins: [\n    require('postcss-transform-variables')({\n      transform: ({ identifier }) =\u003e `web-${identifier}`\n    })\n  ]\n};\n```\n\n## Options\n\n### `transform`\n\nWill be applied on the identifier of each custom property.\n\n#### Type: `Function`\n\n##### Arguments:\n\n- `fields`:\n  - `identifier`: the name of the custom property without the double hyphen (`--`)\n  - `filepath`: the path to the file\n  - `rawCss`: the `css` string\n\n##### Returns: `string`\n\n#### Default: `({ identifier }) =\u003e identifier`\n\n### `warnOnDetectCollision`\n\nWhether to warn on collisions; when the identifiers of two custom properties transform to the same new identifier.\n\n#### Type: `boolean`\n\n#### Default: `true`\n\n### `warnOnDetectNonDeterminism`\n\nWhether to warn when a non-deterministic `transform` is detected; when two new identifiers are transformed from the identifier of the same custom property.\n\n#### Type: `boolean`\n\n#### Default: `true`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkelvindecosta%2Fpostcss-transform-variables","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkelvindecosta%2Fpostcss-transform-variables","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkelvindecosta%2Fpostcss-transform-variables/lists"}