{"id":30107040,"url":"https://github.com/benignware/varss","last_synced_at":"2025-08-10T01:33:00.276Z","repository":{"id":57390884,"uuid":"165549423","full_name":"benignware/varss","owner":"benignware","description":"A scss library for working with css variables","archived":false,"fork":false,"pushed_at":"2019-01-31T17:32:54.000Z","size":319,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-03T20:06:15.795Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benignware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-13T20:11:23.000Z","updated_at":"2019-01-31T17:32:02.000Z","dependencies_parsed_at":"2022-09-26T16:51:05.777Z","dependency_job_id":null,"html_url":"https://github.com/benignware/varss","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/benignware/varss","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benignware%2Fvarss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benignware%2Fvarss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benignware%2Fvarss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benignware%2Fvarss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benignware","download_url":"https://codeload.github.com/benignware/varss/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benignware%2Fvarss/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269492006,"owners_count":24426032,"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-08T02:00:09.200Z","response_time":72,"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":"2025-08-10T01:31:57.478Z","updated_at":"2025-08-10T01:33:00.258Z","avatar_url":"https://github.com/benignware.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# varss\n\nA scss library for working with CSS Variables\n\n\n## Install\n\n```cli\nnpm i varss -D\n```\n\n## Usage\n\nBasically you make use of a mixin `var-set` for variable definition in conjunction with a function `var-get` for accessing your variable as css custom property. You can pass in maps as well and get back maps containing css variables then accordingly.\n\nHere's a complete example...\n\n```scss\n// variables.scss\n$var-prefix: prefix-;\n$var-style: camelCase;\n\n:root {\n  @include var-set((\n    borderWidth: 1px,\n    borderRadius: 3px,\n    fontSize: 12px,\n    context: (\n      primary: blue,\n      secondary: orange\n    ),\n    inverse: (\n      primary: white,\n      secondary: black\n    )\n  ));\n}\n```\n\n```scss\n// Button.scss\n.Button {\n  -webkit-appearance: none;\n  cursor: pointer;\n  padding: 0.25rem 0.1rem;\n  border-style: solid;\n  border-radius: var-get('borderRadius');\n  border-width: var-get('borderWidth');\n  font-size: var-get('fontSize');\n\n  // You may either refer to variables by their flat name...\n  \u0026--outline#{\u0026}--primary {\n    border-color: var-get('contextPrimary');\n    color: var-get('contextPrimary');\n  }\n\n  \u0026--outline#{\u0026}--secondary {\n    border-color: var-get('contextSecondary');\n    color: var-get('contextSecondary');\n  }\n\n  // Or access lists and maps as specified via `var-set`\n  @each $name, $value in var-get('context') {\n    \u0026--#{$name}:not(\u0026--outline) {\n      border-color: $value;\n      background: $value;\n      color: map-get(var-get('inverse'), $name);\n    }\n  }\n}\n\n```\n\nOutput:\n\n```css\n:root {\n  --prefix-borderWidth: 1px;\n  --prefix-borderRadius: 3px;\n  --prefix-fontSize: 12px;\n  --prefix-contextPrimary: blue;\n  --prefix-contextSecondary: orange;\n  --prefix-inversePrimary: white;\n  --prefix-inverseSecondary: black;\n}\n\n.Button {\n  -webkit-appearance: none;\n  cursor: pointer;\n  padding: 0.25rem 0.1rem;\n  border-style: solid;\n  border-radius: var(--prefix-borderRadius);\n  border-width: var(--prefix-borderWidth);\n  font-size: var(--prefix-fontSize);\n}\n\n.Button--outline.Button--primary {\n  border-color: var(--prefix-contextPrimary);\n  color: var(--prefix-contextPrimary);\n}\n\n.Button--outline.Button--secondary {\n  border-color: var(--prefix-contextSecondary);\n  color: var(--prefix-contextSecondary);\n}\n\n.Button--primary:not(.Button--outline) {\n  border-color: var(--prefix-contextPrimary);\n  background: var(--prefix-contextPrimary);\n  color: var(--prefix-inversePrimary);\n}\n\n.Button--secondary:not(.Button--outline) {\n  border-color: var(--prefix-contextSecondary);\n  background: var(--prefix-contextSecondary);\n  color: var(--prefix-inverseSecondary);\n}\n```\n\n\u003e Note: `varss` is intented for being used at application level and is currently not suited for being incorporated into a dedicated scss library\n\n## Development\n\nIn order to run specs, issue the following from your terminal:\n\n```cli\nnpm test\n```\n\nRun dev-server\n\n```cli\nnpm start\n```\n\nCreate a build (for whatever purpose)\n\n```cli\nnpm run build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenignware%2Fvarss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenignware%2Fvarss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenignware%2Fvarss/lists"}