{"id":22221992,"url":"https://github.com/fabiospampinato/css-eval","last_synced_at":"2025-07-27T16:32:10.742Z","repository":{"id":59494572,"uuid":"537606999","full_name":"fabiospampinato/css-eval","owner":"fabiospampinato","description":"Tiny library for fully evaluating CSS properties and variables on a target element.","archived":false,"fork":false,"pushed_at":"2023-09-24T16:28:48.000Z","size":10,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-13T13:35:55.417Z","etag":null,"topics":["css","eval","resolve"],"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/fabiospampinato.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}},"created_at":"2022-09-16T20:16:30.000Z","updated_at":"2024-10-25T20:21:39.000Z","dependencies_parsed_at":"2022-09-17T00:40:33.069Z","dependency_job_id":null,"html_url":"https://github.com/fabiospampinato/css-eval","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fcss-eval","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fcss-eval/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fcss-eval/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fcss-eval/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabiospampinato","download_url":"https://codeload.github.com/fabiospampinato/css-eval/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227817017,"owners_count":17824200,"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","eval","resolve"],"created_at":"2024-12-02T23:16:27.632Z","updated_at":"2025-07-27T16:32:10.736Z","avatar_url":"https://github.com/fabiospampinato.png","language":"TypeScript","readme":"# CSS Eval\n\nTiny library for fully evaluating CSS properties and variables on a target element.\n\n## Install\n\n```sh\nnpm install css-eval\n```\n\n## Usage\n\nThe following functions are provided:\n\n```ts\nfunction get ( property: string, target: HTMLElement | SVGElement | MathMLElement = document.body ): string;\nfunction getAngle ( property: string, target: HTMLElement | SVGElement | MathMLElement = document.body ): number;\nfunction getLength ( property: string, target: HTMLElement | SVGElement | MathMLElement = document.body ): number;\nfunction getTime ( property: string, target: HTMLElement | SVGElement | MathMLElement = document.body ): number;\n```\n\nThey can be used like this:\n\n```ts\nimport Eval from 'css-eval';\n\n// Getting a custom target node, otherwise it'll be \"document.body\" if one is not manually provided\n\nconst target = document.querySelector ( '#foo' );\n\n// Reading an unresolved style property or variable, as a string\n\nEval.get ( 'width' );\nEval.get ( 'width', target );\nEval.get ( '--custom' );\nEval.get ( '--custom', target );\n\n// Reading a resolved angle property or variable, the number of \"deg\" will be returned\n\nEval.getAngle ( 'rotate' );\nEval.getAngle ( 'rotate', target );\nEval.getAngle ( '--custom' );\nEval.getAngle ( '--custom', target );\n\n// Reading a resolved length property or variable, the number of \"px\" will be returned\n\nEval.getLength ( 'width' );\nEval.getLength ( 'width', target );\nEval.getLength ( '--custom' );\nEval.getLength ( '--custom', target );\n\n// Reading a resolved time property or variable, the number of \"ms\" will be returned\n\nEval.getTime ( 'transition-duration' );\nEval.getTime ( 'transition-duration', target );\nEval.getTime ( '--custom' );\nEval.getTime ( '--custom', target );\n```\n\n## License\n\nMIT © Fabio Spampinato\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiospampinato%2Fcss-eval","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabiospampinato%2Fcss-eval","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiospampinato%2Fcss-eval/lists"}