Skip to content

Commit

Permalink
Merge pull request #211 from mattiacci/master
Browse files Browse the repository at this point in the history
Update animation-direction by adding <single-animation-direction>
  • Loading branch information
mattiacci committed Apr 25, 2016
2 parents 5468413 + 93e6a36 commit 7a2eeb2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/css/Properties.js
Expand Up @@ -16,7 +16,7 @@ var Properties = module.exports = {
"alignment-baseline" : "auto | baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical",
"animation" : 1,
"animation-delay" : "<time>#",
"animation-direction" : "[ normal | alternate ]#",
"animation-direction" : "<single-animation-direction>#",
"animation-duration" : "<time>#",
"animation-fill-mode" : "[ none | forwards | backwards | both ]#",
"animation-iteration-count" : "[ <number> | infinite ]#",
Expand Down
3 changes: 3 additions & 0 deletions src/css/ValidationTypes.js
Expand Up @@ -282,6 +282,9 @@ copy(ValidationTypes, {

"<shape-box>": "<box> | margin-box",

"<single-animation-direction>":
"normal | reverse | alternate | alternate-reverse",

"<single-animation-name>": function(part) {
return this["<ident>"](part) &&
/^-?[a-z_][-a-z0-9_]+$/i.test(part) &&
Expand Down
16 changes: 16 additions & 0 deletions tests/css/Validation.js
Expand Up @@ -83,6 +83,22 @@ var YUITest = require("yuitest"),

var suite = new YUITest.TestSuite("Validation Tests");

suite.add(new ValidationTestCase({
property: "animation-direction",

valid: [
"normal",
"reverse",
"alternate",
"alternate-reverse",
"alternate, reverse, normal",
],

invalid: {
"1px" : "Expected (<single-animation-direction>#) but found '1px'."
}
}));

suite.add(new ValidationTestCase({
property: "animation-fill-mode",

Expand Down

0 comments on commit 7a2eeb2

Please sign in to comment.