Sha256: 48b0f675c88747f60c9117bf68a75b3c7896bff7389471c733b451b503402582
Contents?: true
Size: 1.58 KB
Versions: 1
Compression:
Stored size: 1.58 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: Disallow duplicate background-images (using url). # */ # /*global CSSLint*/ # CSSLint.addRule({ # # //rule information # id: "duplicate-background-images", # name: "Disallow duplicate background images", # desc: "Every background-image should be unique. Use a common class for e.g. sprites.", # browsers: "All", # # //initialization # init: function(parser, reporter){ # var rule = this, # stack = {}; # # parser.addListener("property", function(event){ # var name = event.property.text, # value = event.value, # i, len; # # if (name.match(/background/i)) { # for (i=0, len=value.parts.length; i < len; i++) { # if (value.parts[i].type == 'uri') { # if (typeof stack[value.parts[i].uri] === 'undefined') { # stack[value.parts[i].uri] = event; # } # else { # reporter.report("Background image '" + value.parts[i].uri + "' was used multiple times, first declared at line " + stack[value.parts[i].uri].line + ", col " + stack[value.parts[i].uri].col + ".", event.line, event.col, rule); # } # } # } # } # }); # } # });
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sasslint-0.0.1 | lib/sasslint/rules/css/duplicate-background-images.rb |