diff --git a/app/node_views/results.html b/app/node_views/results.html index 52aafed..301788a 100644 --- a/app/node_views/results.html +++ b/app/node_views/results.html @@ -309,6 +309,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.

+
+
+
@@ -345,7 +367,7 @@ -
+
Duplicated selectors
{{phantomasResults.metrics.cssDuplicatedSelectors}} @@ -358,6 +380,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 e51e99b..6c2088f 100644 --- a/app/public/scripts/resultsCtrl.js +++ b/app/public/scripts/resultsCtrl.js @@ -262,7 +262,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'; } @@ -290,6 +291,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 +