|
@@ -487,9 +487,9 @@ var policies = {
|
|
"tool": "phantomas",
|
|
"tool": "phantomas",
|
|
"label": "Rules count",
|
|
"label": "Rules count",
|
|
"message": "<p>Having a huge number of CSS rules hurts performances. If the number of CSS rules is higher than the number of DOM elements, there is clearly a problem.</p><p>Huge stylesheets generally occur when the different pages of a website load all the CSS, concatenated in a single stylesheet, even if a large part of the rules are page-specific. Solution is to create one main CSS file with global rules and one custom file per page.</p>",
|
|
"message": "<p>Having a huge number of CSS rules hurts performances. If the number of CSS rules is higher than the number of DOM elements, there is clearly a problem.</p><p>Huge stylesheets generally occur when the different pages of a website load all the CSS, concatenated in a single stylesheet, even if a large part of the rules are page-specific. Solution is to create one main CSS file with global rules and one custom file per page.</p>",
|
|
- "isOkThreshold": 500,
|
|
|
|
- "isBadThreshold": 2500,
|
|
|
|
- "isAbnormalThreshold": 4000,
|
|
|
|
|
|
+ "isOkThreshold": 750,
|
|
|
|
+ "isBadThreshold": 3000,
|
|
|
|
+ "isAbnormalThreshold": 4500,
|
|
"hasOffenders": false
|
|
"hasOffenders": false
|
|
},
|
|
},
|
|
"cssComplexSelectors": {
|
|
"cssComplexSelectors": {
|
|
@@ -497,7 +497,7 @@ var policies = {
|
|
"label": "Complex selectors",
|
|
"label": "Complex selectors",
|
|
"message": "<p>Complex selectors are CSS selectors with 4 or more expressions, like \"#header ul li .foo\".</p><p>They are adding more work for the browser, and this could be avoided by simplifying selectors.</p>",
|
|
"message": "<p>Complex selectors are CSS selectors with 4 or more expressions, like \"#header ul li .foo\".</p><p>They are adding more work for the browser, and this could be avoided by simplifying selectors.</p>",
|
|
"isOkThreshold": 0,
|
|
"isOkThreshold": 0,
|
|
- "isBadThreshold": 500,
|
|
|
|
|
|
+ "isBadThreshold": 600,
|
|
"isAbnormalThreshold": 2000,
|
|
"isAbnormalThreshold": 2000,
|
|
"hasOffenders": true,
|
|
"hasOffenders": true,
|
|
"offendersTransformFn": function(offenders) {
|
|
"offendersTransformFn": function(offenders) {
|
|
@@ -515,8 +515,8 @@ var policies = {
|
|
"label": "Complex attributes selector",
|
|
"label": "Complex attributes selector",
|
|
"message": "<p>Complex attributes selectors are one of these:<ul><li>.foo[type*=bar] (contains bar)</li><li>.foo[type^=bar] (starts with bar)</li><li>.foo[type|=bar] (starts with bar or bar-)</li><li>.foo[type$=bar] (ends with bar)</li><li>.foo[type~=bar baz] (bar or baz)</li></ul></p><p>Their matching process needs more CPU and it has a cost on performances.</p>",
|
|
"message": "<p>Complex attributes selectors are one of these:<ul><li>.foo[type*=bar] (contains bar)</li><li>.foo[type^=bar] (starts with bar)</li><li>.foo[type|=bar] (starts with bar or bar-)</li><li>.foo[type$=bar] (ends with bar)</li><li>.foo[type~=bar baz] (bar or baz)</li></ul></p><p>Their matching process needs more CPU and it has a cost on performances.</p>",
|
|
"isOkThreshold": 0,
|
|
"isOkThreshold": 0,
|
|
- "isBadThreshold": 50,
|
|
|
|
- "isAbnormalThreshold": 100,
|
|
|
|
|
|
+ "isBadThreshold": 75,
|
|
|
|
+ "isAbnormalThreshold": 150,
|
|
"hasOffenders": true,
|
|
"hasOffenders": true,
|
|
"offendersTransformFn": function(offenders) {
|
|
"offendersTransformFn": function(offenders) {
|
|
return {
|
|
return {
|
|
@@ -600,8 +600,8 @@ var policies = {
|
|
"label": "Duplicated selectors",
|
|
"label": "Duplicated selectors",
|
|
"message": "<p>This is when two or more selectors are strictly identical and should be merged.</p>",
|
|
"message": "<p>This is when two or more selectors are strictly identical and should be merged.</p>",
|
|
"isOkThreshold": 0,
|
|
"isOkThreshold": 0,
|
|
- "isBadThreshold": 40,
|
|
|
|
- "isAbnormalThreshold": 80,
|
|
|
|
|
|
+ "isBadThreshold": 50,
|
|
|
|
+ "isAbnormalThreshold": 100,
|
|
"hasOffenders": true,
|
|
"hasOffenders": true,
|
|
"offendersTransformFn": function(offenders) {
|
|
"offendersTransformFn": function(offenders) {
|
|
return {
|
|
return {
|
|
@@ -629,8 +629,8 @@ var policies = {
|
|
"label": "Duplicated properties",
|
|
"label": "Duplicated properties",
|
|
"message": "<p>This is the number of property definitions duplicated within a selector.</p>",
|
|
"message": "<p>This is the number of property definitions duplicated within a selector.</p>",
|
|
"isOkThreshold": 0,
|
|
"isOkThreshold": 0,
|
|
- "isBadThreshold": 50,
|
|
|
|
- "isAbnormalThreshold": 100,
|
|
|
|
|
|
+ "isBadThreshold": 60,
|
|
|
|
+ "isAbnormalThreshold": 120,
|
|
"hasOffenders": true,
|
|
"hasOffenders": true,
|
|
"offendersTransformFn": function(offenders) {
|
|
"offendersTransformFn": function(offenders) {
|
|
return {
|
|
return {
|
|
@@ -663,7 +663,7 @@ var policies = {
|
|
"label": "Empty rules",
|
|
"label": "Empty rules",
|
|
"message": "<p>Very easy to fix: remove all empty rules.</p>",
|
|
"message": "<p>Very easy to fix: remove all empty rules.</p>",
|
|
"isOkThreshold": 0,
|
|
"isOkThreshold": 0,
|
|
- "isBadThreshold": 40,
|
|
|
|
|
|
+ "isBadThreshold": 50,
|
|
"isAbnormalThreshold": 100,
|
|
"isAbnormalThreshold": 100,
|
|
"hasOffenders": true,
|
|
"hasOffenders": true,
|
|
"offendersTransformFn": function(offenders) {
|
|
"offendersTransformFn": function(offenders) {
|
|
@@ -717,8 +717,8 @@ var policies = {
|
|
"label": "Uses of !important",
|
|
"label": "Uses of !important",
|
|
"message": "<p>It can be useful, but only as a last resort. It is a bad practice because it overrides the normal cascading logic. The more you use !important, the more you need it again to over-override. This conducts to a poor maintainability.</p>",
|
|
"message": "<p>It can be useful, but only as a last resort. It is a bad practice because it overrides the normal cascading logic. The more you use !important, the more you need it again to over-override. This conducts to a poor maintainability.</p>",
|
|
"isOkThreshold": 0,
|
|
"isOkThreshold": 0,
|
|
- "isBadThreshold": 50,
|
|
|
|
- "isAbnormalThreshold": 150,
|
|
|
|
|
|
+ "isBadThreshold": 75,
|
|
|
|
+ "isAbnormalThreshold": 200,
|
|
"hasOffenders": true,
|
|
"hasOffenders": true,
|
|
"offendersTransformFn": function(offenders) {
|
|
"offendersTransformFn": function(offenders) {
|
|
return {
|
|
return {
|
|
@@ -752,7 +752,7 @@ var policies = {
|
|
"label": "Old IE fixes",
|
|
"label": "Old IE fixes",
|
|
"message": "<p>What browser do you need to support? Once you've got the answer, take a look at these old rules that pollute your CSS code and remove them.</p><p>IE6:<ul><li>* html</li><li>html > body (everything but IE6)</li></ul><p><p>IE7:<ul><li><b>*</b>height: 123px;</li><li>height: 123px <b>!ie</b>;</li></ul><p><p>IE9:<ul><li>-ms-filter</li><li>progid:DXImageTransform.Microsoft</li></ul></p>",
|
|
"message": "<p>What browser do you need to support? Once you've got the answer, take a look at these old rules that pollute your CSS code and remove them.</p><p>IE6:<ul><li>* html</li><li>html > body (everything but IE6)</li></ul><p><p>IE7:<ul><li><b>*</b>height: 123px;</li><li>height: 123px <b>!ie</b>;</li></ul><p><p>IE9:<ul><li>-ms-filter</li><li>progid:DXImageTransform.Microsoft</li></ul></p>",
|
|
"isOkThreshold": 0,
|
|
"isOkThreshold": 0,
|
|
- "isBadThreshold": 50,
|
|
|
|
|
|
+ "isBadThreshold": 75,
|
|
"isAbnormalThreshold": 300,
|
|
"isAbnormalThreshold": 300,
|
|
"hasOffenders": true,
|
|
"hasOffenders": true,
|
|
"offendersTransformFn": function(offenders) {
|
|
"offendersTransformFn": function(offenders) {
|
|
@@ -809,7 +809,7 @@ var policies = {
|
|
"label": "Old prefixes",
|
|
"label": "Old prefixes",
|
|
"message": "<p>Many property prefixes such as -moz- or -webkit- are not needed anymore, or by very few people. You can remove them or replace them with the non-prefixed version. This will help reducing your stylesheets weight.</p>",
|
|
"message": "<p>Many property prefixes such as -moz- or -webkit- are not needed anymore, or by very few people. You can remove them or replace them with the non-prefixed version. This will help reducing your stylesheets weight.</p>",
|
|
"isOkThreshold": 0,
|
|
"isOkThreshold": 0,
|
|
- "isBadThreshold": 50,
|
|
|
|
|
|
+ "isBadThreshold": 75,
|
|
"isAbnormalThreshold": 300,
|
|
"isAbnormalThreshold": 300,
|
|
"hasOffenders": true,
|
|
"hasOffenders": true,
|
|
"offendersTransformFn": function(offenders) {
|
|
"offendersTransformFn": function(offenders) {
|
|
@@ -845,7 +845,7 @@ var policies = {
|
|
"label": "Universal selectors",
|
|
"label": "Universal selectors",
|
|
"message": "<p>Universal selectors are the most expensive CSS selectors.</p><p>More informations <a href=\"http://perfectionkills.com/profiling-css-for-fun-and-profit-optimization-notes/\" target=\"_blank\">here</a>.</p>",
|
|
"message": "<p>Universal selectors are the most expensive CSS selectors.</p><p>More informations <a href=\"http://perfectionkills.com/profiling-css-for-fun-and-profit-optimization-notes/\" target=\"_blank\">here</a>.</p>",
|
|
"isOkThreshold": 0,
|
|
"isOkThreshold": 0,
|
|
- "isBadThreshold": 40,
|
|
|
|
|
|
+ "isBadThreshold": 50,
|
|
"isAbnormalThreshold": 150,
|
|
"isAbnormalThreshold": 150,
|
|
"hasOffenders": true,
|
|
"hasOffenders": true,
|
|
"offendersTransformFn": function(offenders) {
|
|
"offendersTransformFn": function(offenders) {
|
|
@@ -863,7 +863,7 @@ var policies = {
|
|
"label": "Redundant body selectors",
|
|
"label": "Redundant body selectors",
|
|
"message": "<p>This is one way to remove complexity from a CSS rule. Generally, when \"body\" is specified in a rule it can be removed, because an element is necessarily inside the body.</p>",
|
|
"message": "<p>This is one way to remove complexity from a CSS rule. Generally, when \"body\" is specified in a rule it can be removed, because an element is necessarily inside the body.</p>",
|
|
"isOkThreshold": 0,
|
|
"isOkThreshold": 0,
|
|
- "isBadThreshold": 50,
|
|
|
|
|
|
+ "isBadThreshold": 60,
|
|
"isAbnormalThreshold": 200,
|
|
"isAbnormalThreshold": 200,
|
|
"hasOffenders": true,
|
|
"hasOffenders": true,
|
|
"offendersTransformFn": function(offenders) {
|
|
"offendersTransformFn": function(offenders) {
|
|
@@ -884,7 +884,7 @@ var policies = {
|
|
"label": "Redundant tags selectors",
|
|
"label": "Redundant tags selectors",
|
|
"message": "<p>Some tags included inside other tags are obvious. For example, when \"ul li\" is specified in a rule, \"ul\" can be removed because the \"li\" element is <b>always</b> inside a \"ul\". Same thing for \"tr td\", \"select option\", ...</p><p>Lowering compexity in CSS selectors can make the page load a little faster.</p>",
|
|
"message": "<p>Some tags included inside other tags are obvious. For example, when \"ul li\" is specified in a rule, \"ul\" can be removed because the \"li\" element is <b>always</b> inside a \"ul\". Same thing for \"tr td\", \"select option\", ...</p><p>Lowering compexity in CSS selectors can make the page load a little faster.</p>",
|
|
"isOkThreshold": 0,
|
|
"isOkThreshold": 0,
|
|
- "isBadThreshold": 50,
|
|
|
|
|
|
+ "isBadThreshold": 60,
|
|
"isAbnormalThreshold": 200,
|
|
"isAbnormalThreshold": 200,
|
|
"hasOffenders": true,
|
|
"hasOffenders": true,
|
|
"offendersTransformFn": function(offenders) {
|
|
"offendersTransformFn": function(offenders) {
|