Sha256: 8da3e119742bc9bc5d51e090d5f4a214f1e5c28506b7a07033e230f1f459319a

Contents?: true

Size: 1.84 KB

Versions: 1

Compression:

Stored size: 1.84 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 text-indent for image replacement if you need to support rtl.
#  *
#  */
# /*global CSSLint*/
# CSSLint.addRule({
# 
#     //rule information
#     id: "text-indent",
#     name: "Disallow negative text-indent",
#     desc: "Checks for text indent less than -99px",
#     browsers: "All",
# 
#     //initialization
#     init: function(parser, reporter){
#         var rule = this,
#             textIndent,
#             direction;
# 
# 
#         function startRule(event){
#             textIndent = false;
#             direction = "inherit";
#         }
# 
#         //event handler for end of rules
#         function endRule(event){
#             if (textIndent && direction != "ltr"){
#                 reporter.report("Negative text-indent doesn't work well with RTL. If you use text-indent for image replacement explicitly set direction for that item to ltr.", textIndent.line, textIndent.col, rule);
#             }
#         }
# 
#         parser.addListener("startrule", startRule);
#         parser.addListener("startfontface", startRule);
# 
#         //check for use of "font-size"
#         parser.addListener("property", function(event){
#             var name = event.property.toString().toLowerCase(),
#                 value = event.value;
# 
#             if (name == "text-indent" && value.parts[0].value < -99){
#                 textIndent = event.property;
#             } else if (name == "direction" && value == "ltr"){
#                 direction = "ltr";
#             }
#         });
# 
#         parser.addListener("endrule", endRule);
#         parser.addListener("endfontface", endRule);
# 
#     }
# 
# });

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sasslint-0.0.1 lib/sasslint/rules/css/text-indent.rb