Sha256: 933304722282c3b7263b6f1d3853a6a04440caefbb2b571a5b8bde8d34ea989f

Contents?: true

Size: 1.78 KB

Versions: 1

Compression:

Stored size: 1.78 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: Don't use IDs for selectors.
#  */
# /*global CSSLint*/
# CSSLint.addRule({
# 
#     //rule information
#     id: "ids",
#     name: "Disallow IDs in selectors",
#     desc: "Selectors should not contain IDs.",
#     browsers: "All",
# 
#     //initialization
#     init: function(parser, reporter){
#         var rule = this;
#         parser.addListener("startrule", function(event){
#             var selectors = event.selectors,
#                 selector,
#                 part,
#                 modifier,
#                 idCount,
#                 i, j, k;
# 
#             for (i=0; i < selectors.length; i++){
#                 selector = selectors[i];
#                 idCount = 0;
# 
#                 for (j=0; j < selector.parts.length; j++){
#                     part = selector.parts[j];
#                     if (part.type == parser.SELECTOR_PART_TYPE){
#                         for (k=0; k < part.modifiers.length; k++){
#                             modifier = part.modifiers[k];
#                             if (modifier.type == "id"){
#                                 idCount++;
#                             }
#                         }
#                     }
#                 }
# 
#                 if (idCount == 1){
#                     reporter.report("Don't use IDs in selectors.", selector.line, selector.col, rule);
#                 } else if (idCount > 1){
#                     reporter.report(idCount + " IDs in the selector, really?", selector.line, selector.col, rule);
#                 }
#             }
# 
#         });
#     }
# 
# });

Version data entries

1 entries across 1 versions & 1 rubygems

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