{"id":19544711,"url":"https://github.com/alexandrstudio/postcss-export-vars","last_synced_at":"2025-04-26T18:31:48.370Z","repository":{"id":57146232,"uuid":"56143357","full_name":"alexandrstudio/postcss-export-vars","owner":"alexandrstudio","description":"PostCSS plugin to export variables as JSON or JS constants for additional usage.","archived":false,"fork":false,"pushed_at":"2016-05-03T12:21:25.000Z","size":9,"stargazers_count":21,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-04T17:11:09.273Z","etag":null,"topics":["json","postcss"],"latest_commit_sha":null,"homepage":null,"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/alexandrstudio.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":"2016-04-13T10:41:25.000Z","updated_at":"2025-01-29T11:29:28.000Z","dependencies_parsed_at":"2022-09-06T05:51:07.004Z","dependency_job_id":null,"html_url":"https://github.com/alexandrstudio/postcss-export-vars","commit_stats":null,"previous_names":["nahody/postcss-export-vars","alexandrstudio/postcss-export-vars"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandrstudio%2Fpostcss-export-vars","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandrstudio%2Fpostcss-export-vars/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandrstudio%2Fpostcss-export-vars/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandrstudio%2Fpostcss-export-vars/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexandrstudio","download_url":"https://codeload.github.com/alexandrstudio/postcss-export-vars/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251035794,"owners_count":21526424,"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":["json","postcss"],"created_at":"2024-11-11T03:31:07.574Z","updated_at":"2025-04-26T18:31:44.246Z","avatar_url":"https://github.com/alexandrstudio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostCSS Export Vars [![Build Status][ci-img]][ci]\n\n[PostCSS] plugin to export variables definitions as JSON or JS constants.\nIt detect \"custom variables\" and SASS style variables and export them to JSON or JS file.    \nVariable that will refer to other variables are also dissolved and only the value is adopted.\n\nThis plugin was created for a project, witch should use defined css colors also for highcharts.\nAll suggestions are welcome!\n\n[PostCSS]: https://github.com/postcss/postcss\n[ci-img]:  https://travis-ci.org/nahody/postcss-export-vars.svg\n[ci]:      https://travis-ci.org/nahody/postcss-export-vars\n\n## Options\nAll options are mandatory.\n\n**file**\nExport file name. Extension is not required and will be set automatically.\nDefault file name is ```postcss_vars```\n\n**type**\nExport format. Default is JSON. Possible values are ```json``` and ```js```.\n\n**match**\nThe match option is an array of string the property name / variable must contain to limit the result for a specific group of variables.\nWhen option is missing or an empty array, all properties / variables are taken.\n\n```json\n{\n    file: 'my-vars',\n    type: 'js',\n    match: ['-color', 'font']\n}\n```\n\n## Example\n\n**CSS Source:**\n```css\n:root {\n    --var-color1: rgb(255, 255, 200);\n    --var-padding: 10px;\n    --var-padding-sub: var(--var-padding);\n}\n\n$var-color2: rgb(30, 100, 255);\n$var-margin: 20px;\n```\n\n**JSON Result:**\n```JSON\n{\n\t  \"varColor1\": \"rgb(255, 255, 200)\",\n\t  \"varPadding\": \"10px\",\n\t  \"varPadding-sub\": \"10px\",\n\t  \"varColor2\": \"rgb(30, 100, 255)\",\n\t  \"varMargin\": \"20px\"\n}\n```\n\n**JavaScript Result:**\n```JS\nconst varColor1 = 'rgb(255, 255, 200)';\nconst varPadding = '10px';\nconst varPadding-sub = '10px';\nconst varColor2 = 'rgb(30, 100, 255)';\nconst varMargin = '20px';\n```\n\n## Usage\n\n```js\npostcss([ require('postcss-export-vars') ])\n```\n\nSee [PostCSS] docs for examples for your environment.\n\n## Notice\nThe plugin DO NOT tranform your PostCSS. It collects all definition and converts them to the required format. Therefore, the export to a file must be made and can not stream as PostCSS be returned.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexandrstudio%2Fpostcss-export-vars","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexandrstudio%2Fpostcss-export-vars","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexandrstudio%2Fpostcss-export-vars/lists"}