diff --git a/app/node_views/results.html b/app/node_views/results.html index 3113b2c..879a17e 100644 --- a/app/node_views/results.html +++ b/app/node_views/results.html @@ -310,6 +310,28 @@ +
+
Complex attributes selector
+
+ {{phantomasResults.metrics.cssComplexSelectorsByAttribute}} + +
+
+
+ +

Complex attributes selectors are one of these: +

    +
  • .foo[type*=bar] (contains bar)
  • +
  • .foo[type^=bar] (starts with bar)
  • +
  • .foo[type|=bar] (starts with bar or bar-)
  • +
  • .foo[type$=bar] (ends with bar)
  • +
  • .foo[type~=bar baz] (bar or baz)
  • +
+

+

Their matching process needs more CPU and it has a cost on performances.

+
+
+
@@ -346,7 +368,7 @@ -
+
Duplicated selectors
{{phantomasResults.metrics.cssDuplicatedSelectors}} @@ -359,6 +381,19 @@
+
+
Duplicated properties
+
+ {{phantomasResults.metrics.cssDuplicatedProperties}} + +
+
+
+ +

This is the number of property definitions duplicated within a selector.

+
+
+
Empty rules
diff --git a/app/public/scripts/resultsCtrl.js b/app/public/scripts/resultsCtrl.js index 26248a2..d8c9aaf 100644 --- a/app/public/scripts/resultsCtrl.js +++ b/app/public/scripts/resultsCtrl.js @@ -296,7 +296,8 @@ app.controller('ResultsCtrl', function ($scope) { var note = 'A'; var score = $scope.phantomasResults.metrics.cssRules + - $scope.phantomasResults.metrics.cssComplexSelectors * 5; + $scope.phantomasResults.metrics.cssComplexSelectors * 5 + + $scope.phantomasResults.metrics.cssComplexSelectorsByAttribute * 15; if (score > 500) { note = 'B'; } @@ -324,6 +325,7 @@ app.controller('ResultsCtrl', function ($scope) { var note = 'A'; var score = $scope.phantomasResults.metrics.cssDuplicatedSelectors + + $scope.phantomasResults.metrics.cssDuplicatedProperties + $scope.phantomasResults.metrics.cssEmptyRules + $scope.phantomasResults.metrics.cssExpressions * 10 + $scope.phantomasResults.metrics.cssImportants * 2 +