{"id":16713786,"url":"https://github.com/ryuran/postcss-variables-prefixer","last_synced_at":"2025-03-21T20:33:34.037Z","repository":{"id":35812843,"uuid":"219466112","full_name":"ryuran/postcss-variables-prefixer","owner":"ryuran","description":"PostCSS plugin to add a prefix to all css custom properties.","archived":false,"fork":false,"pushed_at":"2023-03-07T04:57:12.000Z","size":931,"stargazers_count":8,"open_issues_count":6,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T08:42:59.280Z","etag":null,"topics":["hacktoberfest","postcss-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/ryuran.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-04T09:41:21.000Z","updated_at":"2024-02-04T21:53:13.000Z","dependencies_parsed_at":"2024-06-19T00:17:54.601Z","dependency_job_id":"186ae883-3d94-4f84-a577-2b898ff732ec","html_url":"https://github.com/ryuran/postcss-variables-prefixer","commit_stats":{"total_commits":64,"total_committers":7,"mean_commits":9.142857142857142,"dds":0.6875,"last_synced_commit":"2693eaa4e21d41221228953fac615609c98e11ec"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryuran%2Fpostcss-variables-prefixer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryuran%2Fpostcss-variables-prefixer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryuran%2Fpostcss-variables-prefixer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryuran%2Fpostcss-variables-prefixer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryuran","download_url":"https://codeload.github.com/ryuran/postcss-variables-prefixer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244866371,"owners_count":20523503,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["hacktoberfest","postcss-plugin"],"created_at":"2024-10-12T20:48:04.017Z","updated_at":"2025-03-21T20:33:33.602Z","avatar_url":"https://github.com/ryuran.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# postcss-variables-prefixer\n![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/npm/postcss-variables-prefixer)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n\nPostCSS plugin to add a prefix to all css custom properties.\n\n## Usage\n### With [PostCSS cli](https://github.com/postcss/postcss-cli):\n\nInstall `postcss`, `postcss-cli` and `postcss-variables-prefixer` on your project directory:\n\n```\nnpm install postcss postcss-cli postcss-variables-prefixer --save-dev\n```\n\nand in your package.json\n\n```json\n\"scripts\": {\n  \"postcss\": \"postcss input.css -u postcss-variables-prefixer -o output.css\"\n}\n```\n\n### Others\n```js\npostcss([ require('postcss-variables-prefixer')({ /* options */ }) ])\n```\n\n### Options\n#### prefix\nType: `string`\u003cbr\u003e\nDefault: none\n\nString to be used as prefix\n\n#### ignore\nType: `array`\u003cbr\u003e\nDefault: `[]`\n\nArray of css custom properties to be ignored by the plugin, accepts string and regex.\n\n## Example\nExample of usage with results generated by the plugin.\n\n### Code\n```js\nconst postcss = require('postcss');\nconst prefixer = require('postcss-variables-prefixer');\n\nconst input = fs.readFileSync('path/to/file.css',  'utf-8');\n\nconst output = postcss([\n  prefixer({\n        prefix: 'prefix-',\n        ignore: [ /bar/, '--ignore' ]\n    })\n]).process(input);\n\n```\n\n### Input:\n```css\n:root {\n  --foo: red;\n  --foo-bar: green;\n  --ignore: 300px;\n  --not-ignored: 100px;\n  --bar: yellow;\n}\n\ndiv {\n  background-color: var(--foo);\n  color: var(--foo-bar);\n  width: var(--ignore);\n  height: var(--not-ignored);\n  border-color: var(--bar)\n}\n```\n\n### Output:\n```css\n:root {\n  --prefix-foo: red;\n  --foo-bar: green;\n  --ignore: 300px;\n  --prefix-not-ignored: 100px;\n  --bar: yellow;\n}\n\ndiv {\n  background-color: var(--prefix-foo);\n  color: var(--foo-bar);\n  width: var(--ignore);\n  height: var(--prefix-not-ignored);\n  border-color: var(--bar)\n}\n```\n\n## Credits\n\nPlugin inspired by [postcss-prefixer](https://github.com/marceloucker/postcss-prefixer) created by [marceloucker](https://github.com/marceloucker).\n\nThanks to [Andrey Sitnik @ai](https://github.com/ai) and [Jonathan Neal @jonathantneal](https://github.com/jonathantneal) for the help.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryuran%2Fpostcss-variables-prefixer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryuran%2Fpostcss-variables-prefixer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryuran%2Fpostcss-variables-prefixer/lists"}