You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/rules/text-indent.js
+15-13Lines changed: 15 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
/*
2
-
* Rule: Don't use text-indent for image replacement if you need to support rtl.
3
-
*
2
+
* Rule: Don't use text-indent for image replacement if you need to support rtl.
3
+
*
4
4
*/
5
5
/*global CSSLint*/
6
6
CSSLint.addRule({
@@ -10,27 +10,29 @@ CSSLint.addRule({
10
10
name: "Disallow negative text-indent",
11
11
desc: "Checks for text indent less than -99px",
12
12
browsers: "All",
13
-
13
+
14
14
//initialization
15
15
init: function(parser,reporter){
16
16
varrule=this,
17
-
textIndent=false;
18
-
19
-
17
+
textIndent,
18
+
direction;
19
+
20
+
20
21
functionstartRule(event){
21
22
textIndent=false;
23
+
direction="inherit";
22
24
}
23
-
25
+
24
26
//event handler for end of rules
25
27
functionendRule(event){
26
-
if(textIndent){
28
+
if(textIndent&&direction!="ltr"){
27
29
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);
Assert.areEqual("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.",result.messages[0].message);
0 commit comments