{"id":16346637,"url":"https://github.com/matype/css-specificity","last_synced_at":"2025-06-23T09:36:13.930Z","repository":{"id":23696862,"uuid":"27068910","full_name":"matype/css-specificity","owner":"matype","description":"CSS selector specificity calculator","archived":false,"fork":false,"pushed_at":"2014-11-24T16:13:40.000Z","size":140,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-18T22:35:34.604Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matype.png","metadata":{"files":{"readme":"readme.markdown","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":"2014-11-24T09:22:02.000Z","updated_at":"2018-02-20T19:20:04.000Z","dependencies_parsed_at":"2022-08-21T21:40:35.466Z","dependency_job_id":null,"html_url":"https://github.com/matype/css-specificity","commit_stats":null,"previous_names":["morishitter/css-specificity","matype/css-specificity","masaakim/css-specificity"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/matype/css-specificity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matype%2Fcss-specificity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matype%2Fcss-specificity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matype%2Fcss-specificity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matype%2Fcss-specificity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matype","download_url":"https://codeload.github.com/matype/css-specificity/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matype%2Fcss-specificity/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261453355,"owners_count":23160500,"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":[],"created_at":"2024-10-11T00:35:50.924Z","updated_at":"2025-06-23T09:36:08.919Z","avatar_url":"https://github.com/matype.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# css-specificity [![Build Status](https://travis-ci.org/morishitter/css-specificity.svg)](https://travis-ci.org/morishitter/css-specificity)\n\nCSS3 selector specificity calculator.\n\ncss-specificity is wrapper module of [specimen](https://github.com/brettstimmerman/specimen).\n\n## Installation\n\n```shell\n$ npm install css-specificity\n```\n\n## Example\n\n```javascript\nvar specificity = require('css-specificity')\n\nvar calc = specificity.calc('.class, p.sel:after')\nvar winner = specificity.vs('.class', 'p.sel:after')\n\nconsole.log(calc)\n/*\n[\n    {\n        'selector': '.class',\n        'specificity': [0, 0, 1, 0],\n        'a': 0,\n        'b': 1,\n        'c': 0\n    },\n    {\n        'selector': 'p.sel:after',\n        'specificity': [0, 0, 1, 2],\n        'a': 0,\n        'b': 1,\n        'c': 2\n    }\n]\n*/\n\nconsole.log(winner)\n// 'p.sel:after'\n```\n\n## API\n\n### `specificity.calc(selector)`\n\nreturn caluculation result.\n\n### `specificity.vs(selector1, selector2)`\n\nreturn selector has higher specificity.\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2014 Masaaki Morishita\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatype%2Fcss-specificity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatype%2Fcss-specificity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatype%2Fcss-specificity/lists"}