{"id":19373381,"url":"https://github.com/xop/sass-vars-to-js","last_synced_at":"2025-07-25T07:36:12.489Z","repository":{"id":80031732,"uuid":"55288906","full_name":"XOP/sass-vars-to-js","owner":"XOP","description":"variables.scss to [variables Object] converter","archived":false,"fork":false,"pushed_at":"2017-06-05T02:56:42.000Z","size":32,"stargazers_count":10,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-23T16:34:26.875Z","etag":null,"topics":[],"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/XOP.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":"2016-04-02T10:18:28.000Z","updated_at":"2023-06-19T19:12:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"2950cc9b-a57c-45da-9d24-33fb3063be8b","html_url":"https://github.com/XOP/sass-vars-to-js","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/XOP/sass-vars-to-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XOP%2Fsass-vars-to-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XOP%2Fsass-vars-to-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XOP%2Fsass-vars-to-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XOP%2Fsass-vars-to-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XOP","download_url":"https://codeload.github.com/XOP/sass-vars-to-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XOP%2Fsass-vars-to-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266973969,"owners_count":24014807,"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-07-25T02:00:09.625Z","response_time":70,"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":[],"created_at":"2024-11-10T08:28:01.121Z","updated_at":"2025-07-25T07:36:12.443Z","avatar_url":"https://github.com/XOP.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sass-vars-to-js\n\n\u003e variables.scss to [variables Object] converter\n\n[![npm version](https://badge.fury.io/js/sass-vars-to-js.svg)](https://badge.fury.io/js/sass-vars-to-js) [![dependencies](https://david-dm.org/XOP/sass-vars-to-js.svg)](https://david-dm.org/XOP/sass-vars-to-js) [![devDependecies](https://david-dm.org/XOP/sass-vars-to-js/dev-status.svg)](https://david-dm.org/XOP/sass-vars-to-js#info=devDependencies)\n\n## About\n\nSometimes you just need to use SASS variables in JS without incorporating complex logic.\nAnd no CSS-module-specific logic behind this.\n\n\n### Important\n\n**Not actively maintained**\n\nIf you want to cooperate or even adopt the project, please [let me know](mailto:stewiekillsloiss@gmail.com).\n\n\n## Installation and Changes\n\nInstallation is straightforward:\n```\n$ npm install --save-dev sass-vars-to-js\n```\n\nRun tests:\n```\n$ npm test\n```\n\nCompile commonjs version with [babel](https://babeljs.io/):\n```\n$ npm run build\n```\n\n\n## Usage\n\nThere are two ways of requiring the module:\n\nBy default requiring module gets the commonjs version:\n```js\nvar converter = require('node_modules/sass-vars-to-js');\n```\n\nIf you prefer (by whatever reasons) ES6 version, you can also try:\n```js\nimport converter from 'node_modules/sass-vars-to-js/src'\n```\n\nFunction accepts string - path to a SASS file, containing variables.\nIt returns the object, very similar to the variable definition syntax:\n\n**variables.scss**\n```scss\n$color-brand-primary: #1711e2;\n$color-brand-secondary: #fd0f79;\n\n$footer-bg-color: $color-brand-primary;\n```\n\n**colors.js**\n```js\nimport converter from 'sass-vars-to-js';\n\nconst variables = converter(path/to/variables.scss);\n\n// {\n//     'color-brand-primary': '#1711e2',\n//     'color-brand-secondary': '#fd0f79',\n//     'footer-bg-color': '#1711e2'\n// }\n\nconst colors = {\n    brandPrimary: variables['color-brand-primary'],\n    brandSecondary: variables['color-brand-secondary']\n};\n```\n\n\n## Limits of use\n\nPlease be aware of current version (0.x - 1.x) limitations:\n\n- maps and other complex stuff is not supported\n- sass expressions not supported\n- sass functions not supported\n\n\n## License: [MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxop%2Fsass-vars-to-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxop%2Fsass-vars-to-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxop%2Fsass-vars-to-js/lists"}