Sha256: ff09884ac9dc9088fac768639d44d9e920a8614e323adbd322e010c059e24d1f

Contents?: true

Size: 1.43 KB

Versions: 1

Compression:

Stored size: 1.43 KB

Contents

# 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: Make sure !important is not overused, this could lead to specificity
#  * war. Display a warning on !important declarations, an error if it's
#  * used more at least 10 times.
#  */
# /*global CSSLint*/
# CSSLint.addRule({
# 
#     //rule information
#     id: "important",
#     name: "Disallow !important",
#     desc: "Be careful when using !important declaration",
#     browsers: "All",
# 
#     //initialization
#     init: function(parser, reporter){
#         var rule = this,
#             count = 0;
# 
#         //warn that important is used and increment the declaration counter
#         parser.addListener("property", function(event){
#             if (event.important === true){
#                 count++;
#                 reporter.report("Use of !important", event.line, event.col, rule);
#             }
#         });
# 
#         //if there are more than 10, show an error
#         parser.addListener("endstylesheet", function(){
#             reporter.stat("important", count);
#             if (count >= 10){
#                 reporter.rollupWarn("Too many !important declarations (" + count + "), try to use less than 10 to avoid specificity issues.", rule);
#             }
#         });
#     }
# 
# });

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sasslint-0.0.1 lib/sasslint/rules/css/important.rb