MCPcopy Create free account
hub / github.com/Inviz/lsd / getSpecificity

Function getSpecificity

Source/Sheet.js:31–41  ·  view source on GitHub ↗
(selector)

Source from the content-addressed store, hash-verified

29 var rules = [];
30
31 var getSpecificity = function(selector){
32 specificity = 0;
33 selector.each(function(chunk){
34 if (chunk.tag && chunk.tag != '*') specificity++;
35 if (chunk.id) specificity += 100;
36 for (var i in chunk.attributes) specificity++;
37 specificity += (chunk.pseudos || []).length;
38 specificity += (chunk.classes || []).length * 10;
39 });
40 return specificity;
41 };
42
43 ART.Sheet.define = function(selectors, style){
44 Slick.parse(selectors).expressions.each(function(selector){

Callers 1

Sheet.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected