# This rule is taken from https://github.com/stubbornella/csslint/tree/master/src/rules # # # Copyright (c) 2011 Nicole Sullivan and Nicholas C. Zakas. All rights reserved. # TODO: Paste the CSSLint LICENSE here. # # # /* # * Rule: Warn people past the IE 4095 limit # */ # /*global CSSLint*/ # CSSLint.addRule({ # # //rule information # id: "selector-max", # name: "Error when past the 4095 selector limit for IE", # desc: "Will error when selector count is > 4095.", # browsers: "IE", # # //initialization # init: function(parser, reporter){ # var rule = this, count = 0; # # parser.addListener('startrule',function(event) { # count += event.selectors.length; # }); # # parser.addListener("endstylesheet", function() { # if (count > 4095) { # reporter.report("You have " + count + " selectors. Internet Explorer supports a maximum of 4095 selectors per stylesheet. Consider refactoring.",0,0,rule); # } # }); # } # # });