Skip to content

Commit 696a459

Browse files
committed
Merge pull request #124 from mattiacci/currentColor
Add 'currentColor' keyword to <color>
2 parents b956a6e + 2f20b21 commit 696a459

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/css/ValidationTypes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ var ValidationTypes = {
129129
},
130130

131131
"<color>": function(part){
132-
return part.type == "color" || part == "transparent";
132+
return part.type == "color" || part == "transparent" || part == "currentColor";
133133
},
134134

135135
"<number>": function(part){

tests/css/Validation.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,23 @@
140140
}
141141
}));
142142

143+
suite.add(new ValidationTestCase({
144+
property: "background-color",
145+
146+
valid: [
147+
"red",
148+
"#f00",
149+
"inherit",
150+
"transparent",
151+
"currentColor"
152+
],
153+
154+
invalid: {
155+
"foo" : "Expected (<color> | inherit) but found 'foo'.",
156+
"invert" : "Expected (<color> | inherit) but found 'invert'.",
157+
}
158+
}));
159+
143160
suite.add(new ValidationTestCase({
144161
property: "background-image",
145162

@@ -560,7 +577,8 @@
560577
"red",
561578
"#f00",
562579
"inherit",
563-
580+
"transparent",
581+
"currentColor"
564582
],
565583

566584
invalid: {

0 commit comments

Comments
 (0)