Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS Specificity #4

Closed
plasticine opened this issue Dec 19, 2013 · 3 comments · Fixed by #24
Closed

CSS Specificity #4

plasticine opened this issue Dec 19, 2013 · 3 comments · Fixed by #24
Assignees
Milestone

Comments

@plasticine
Copy link
Contributor

Would be cool addition to include CSS specificity into the metrics provided.

Specificity is great as it gives you information about what your rules are actually made up of, not just how many you have, etc.

I guess you could calculate specificity for all rules and then provide things like;

  • average rule specificity
  • total #id, .class and <element> specificities
@macbre
Copy link
Owner

macbre commented Dec 20, 2013

Use specificity npm module

@ghost ghost assigned macbre Dec 21, 2013
@macbre
Copy link
Owner

macbre commented Dec 22, 2013

Example:

{
  "metrics": {
    "specificityIdAvg": 0.05,
    "specificityIdTotal": 35,
    "specificityClassAvg": 1.25,
    "specificityClassTotal": 872,
    "specificityTagAvg": 0.78,
    "specificityTagTotal": 548
  }
}
  analyze-css:specificity .search-result figure.image:hover > .price: 041 +0ms
  analyze-css:specificity #slideshow > form input[type="text"]: 112 +0ms

@plasticine
Copy link
Contributor Author

This is just awesome! Thanks! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants