{"id":19716494,"url":"https://github.com/dawaltconley/bg-size-parser","last_synced_at":"2026-04-13T04:03:17.055Z","repository":{"id":57189582,"uuid":"302118969","full_name":"dawaltconley/bg-size-parser","owner":"dawaltconley","description":"A parser for valid background-size CSS values.","archived":false,"fork":false,"pushed_at":"2022-03-31T05:04:19.000Z","size":69,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-10T17:07:42.485Z","etag":null,"topics":["css","parse","parser"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/bg-size-parser","language":"JavaScript","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/dawaltconley.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":"2020-10-07T18:00:42.000Z","updated_at":"2022-03-06T09:23:06.000Z","dependencies_parsed_at":"2022-09-15T06:02:22.247Z","dependency_job_id":null,"html_url":"https://github.com/dawaltconley/bg-size-parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawaltconley%2Fbg-size-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawaltconley%2Fbg-size-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawaltconley%2Fbg-size-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawaltconley%2Fbg-size-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dawaltconley","download_url":"https://codeload.github.com/dawaltconley/bg-size-parser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241037159,"owners_count":19898290,"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":["css","parse","parser"],"created_at":"2024-11-11T22:42:22.887Z","updated_at":"2025-12-31T01:12:39.511Z","avatar_url":"https://github.com/dawaltconley.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Background Size Parser\n\nParses values for the CSS `background-size` property.\n\n## Usage\n\nThe parse method takes [any valid](https://developer.mozilla.org/en-US/docs/Web/CSS/background-size) `background-size` property as a string.\n\n```javascript\nconst { parse } = require('bg-size-parser');\n\nparse('3em 25%');\n\n// [{\n//   width: { size: 3, unit: 'em' },\n//   height: { size: 25, unit: '%' }\n// }]\n\nparse('cover');\n\n// [{\n//   keyword: 'cover'\n// }]\n\nparse('6px, auto, contain');\n\n// [\n//   {\n//     width: { size: 6, unit: 'px' },\n//     height: { size: 'auto' }\n//   },\n//   {\n//     width: { size: 'auto' },\n//     height: { size: 'auto' }\n//   },\n//   { keyword: 'contain' }\n// ]\n\nparse('calc(100% + 200px) 100px');\n\n// [\n//   {\n//     width: { calculation: 'calc(100% + 200px)' },\n//     height: { size: 100, unit: 'px' }\n//   }\n// ]\n\nparse('400px var(--foo, 100px)');\n\n// [\n//   {\n//     width: { size: 400, unit: 'px' },\n//     height: {\n//       variable: 'var(--foo, 100px)',\n//       name: '--foo',\n//       fallback: '100px'\n//     }\n//   }\n// ]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdawaltconley%2Fbg-size-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdawaltconley%2Fbg-size-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdawaltconley%2Fbg-size-parser/lists"}