Skip to content

Commit 0c85706

Browse files
committed
Merge pull request #194 from cscott/padding-calc
Allow calculated values for padding.
2 parents cbd97f7 + 99a8233 commit 0c85706

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/css/ValidationTypes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ var ValidationTypes = {
181181
},
182182

183183
"<padding-width>": function(part){
184-
return part.value >= 0 && (this["<length>"](part) || this["<percentage>"](part));
184+
return (this["<length>"](part) || this["<percentage>"](part)) &&
185+
(String(part) === "0" || part.type === "function" || (part.value) >= 0);
185186
},
186187

187188
"<shape>": function(part){

tests/css/Validation.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,8 +1202,11 @@
12021202
property: "padding-left",
12031203

12041204
valid: [
1205+
"0",
12051206
"6px",
12061207
"3%",
1208+
"1em",
1209+
"calc(100% - 80px)",
12071210
"inherit"
12081211
],
12091212

0 commit comments

Comments
 (0)