{"id":23162740,"url":"https://github.com/metonym/postcss-inline-css-vars","last_synced_at":"2025-08-21T01:09:32.294Z","repository":{"id":268311269,"uuid":"903946149","full_name":"metonym/postcss-inline-css-vars","owner":"metonym","description":"PostCSS plugin to inline CSS variables","archived":false,"fork":false,"pushed_at":"2025-07-06T02:16:39.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-17T21:38:49.517Z","etag":null,"topics":["css-variables","postcss","postcss-plugin"],"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/metonym.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-16T00:17:32.000Z","updated_at":"2025-07-06T02:16:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"5d1b2db0-7a0f-4724-a10c-c3a92f687715","html_url":"https://github.com/metonym/postcss-inline-css-vars","commit_stats":null,"previous_names":["metonym/postcss-inline-css-vars"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/metonym/postcss-inline-css-vars","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metonym%2Fpostcss-inline-css-vars","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metonym%2Fpostcss-inline-css-vars/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metonym%2Fpostcss-inline-css-vars/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metonym%2Fpostcss-inline-css-vars/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metonym","download_url":"https://codeload.github.com/metonym/postcss-inline-css-vars/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metonym%2Fpostcss-inline-css-vars/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271411089,"owners_count":24754854,"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","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-variables","postcss","postcss-plugin"],"created_at":"2024-12-18T00:13:15.467Z","updated_at":"2025-08-21T01:09:32.271Z","avatar_url":"https://github.com/metonym.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# postcss-inline-css-vars\n\n\u003e PostCSS plugin to inline `:root` CSS variables.\n\nThis PostCSS plugin inlines CSS custom properties (CSS variables) by replacing `var()` references with their actual values.\n\n```diff\n- :root {\n-  --primary-color: #000000;\n- }\n\n.button {\n- color: var(--primary-color);\n+ color: #000000;\n}\n```\n\nOnce processed, the `:root` CSS variables are removed from the output.\n\nThe plugin supports nested variables.\n\n```css\n:root {\n  --primary: #ff0000;\n  --button-color: var(--primary);\n}\n```\n\nNon-existent CSS variables are removed from the output. The `:root` declaration will still be removed.\n\n```css\n:root {\n  --primary: #ff0000;\n}\n\n.button {\n  color: var(--button-color); /* Declaration is removed */\n}\n```\n\nIf the input contains `:root` declarations with other selectors, all `:root` declarations will be preserved.\n\nFor instance, the following example assumes dynamically applied themes. As such, CSS variables cannot be inlined without having to generate more CSS.\n\n```css\n:root {\n  --primary-color: #ffffff;\n}\n\n:root.dark {\n  --primary-color: #000000;\n}\n```\n\n## Installation\n\n```bash\n# NPM\nnpm i -D postcss-inline-css-vars\n\n# pnpm\npnpm i -D postcss-inline-css-vars\n\n# Yarn\nyarn add -D postcss-inline-css-vars\n\n# Bun\nbun add -D postcss-inline-css-vars\n```\n\n## Usage\n\n### Basic Usage\n\n```js\nimport { inlineCssVars } from \"postcss-inline-css-vars\";\n\npostcss(inlineCssVars()).process(css);\n```\n\n## Changelog\n\n[CHANGELOG.md](CHANGELOG.md)\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetonym%2Fpostcss-inline-css-vars","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetonym%2Fpostcss-inline-css-vars","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetonym%2Fpostcss-inline-css-vars/lists"}