# 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: You shouldn't need more than 9 font-size declarations. # */ # # /*global CSSLint*/ # CSSLint.addRule({ # # //rule information # id: "font-sizes", # name: "Disallow too many font sizes", # desc: "Checks the number of font-size declarations.", # browsers: "All", # # //initialization # init: function(parser, reporter){ # var rule = this, # count = 0; # # //check for use of "font-size" # parser.addListener("property", function(event){ # if (event.property == "font-size"){ # count++; # } # }); # # //report the results # parser.addListener("endstylesheet", function(){ # reporter.stat("font-sizes", count); # if (count >= 10){ # reporter.rollupWarn("Too many font-size declarations (" + count + "), abstraction needed.", rule); # } # }); # } # # });