diff --git a/lib/style-transform.js b/lib/style-transform.js index a4698d7e..7eeed4a5 100644 --- a/lib/style-transform.js +++ b/lib/style-transform.js @@ -160,13 +160,15 @@ // animation: a, n, i characters if (first === 97 && second === 110 && third === 105) { + line = line.substring(0, line.length-1); + var ninth = line.charCodeAt(9) || 0; var tenth = line.charCodeAt(10) || 0; var colon = line.indexOf(':')+1; var build = line.substring(0, colon); - var anims = line.substring(colon).split(','); + var anims = line.substring(colon).trim().split(','); // short hand animation syntax if (ninth !== 45) { @@ -209,6 +211,8 @@ build += (tenth !== 110 ? '' : animationSuffix) + anims[0].trim(); } + build += ';'; + // vendor prefix line = '-webkit-' + build + '-moz-' + build + build; } diff --git a/test/fixtures/transform.css b/test/fixtures/transform.css index 12fb71e6..217f1c29 100644 --- a/test/fixtures/transform.css +++ b/test/fixtures/transform.css @@ -36,6 +36,7 @@ p :global(span:not(.test)) { p, h1 { color: blue; + animation: hahaha 3s ease forwards infinite; animation-name: hahaha; animation-delay: 100ms; } diff --git a/test/fixtures/transform.out.css b/test/fixtures/transform.out.css index 04ef114f..fc082290 100644 --- a/test/fixtures/transform.out.css +++ b/test/fixtures/transform.out.css @@ -1 +1 @@ -p {color: blue}p[data-jsx="123"] {color: red;}p[data-jsx="123"]{color: red}*[data-jsx="123"] {color: blue;}[href="woot"][data-jsx="123"] {color: red;}p[data-jsx="123"] a[data-jsx="123"] span[data-jsx="123"] {color: red;}p[data-jsx="123"] span {background: blue}p[data-jsx="123"] a[title="'w ' ' t'"][data-jsx="123"] {margin: auto}p[data-jsx="123"] span:not(.test) {color: green}p[data-jsx="123"],h1[data-jsx="123"] {color: blue;-webkit-animation-name:a123hahaha;-moz-animation-name:a123hahaha;animation-name:a123hahaha;-webkit-animation-delay:100ms;-moz-animation-delay:100ms;animation-delay:100ms;}p[data-jsx="123"]:hover {color: red;}p[data-jsx="123"]::before {color: red;}[data-jsx="123"]:hover {color: red;}[data-jsx="123"]::before {color: red;}[data-jsx="123"]:hover p[data-jsx="123"] {color: red;}p[data-jsx="123"] + a[data-jsx="123"] {color: red;}p[data-jsx="123"] ~ a[data-jsx="123"] {color: red;}p[data-jsx="123"] > a[data-jsx="123"] {color: red;}p[data-jsx="123"] >> a[data-jsx="123"] {color: red;}@-webkit-keyframes a123hahaha {from { top: 0 }to { top: 100 }}@-moz-keyframes a123hahaha {from { top: 0 }to { top: 100 }}@keyframes a123hahaha {from { top: 0 }to { top: 100 }}@media (min-width: 500px) {.test[data-jsx="123"] {color: red;}}.test[data-jsx="123"] {display: block;} +p {color: blue}p[data-jsx="123"] {color: red;}p[data-jsx="123"]{color: red}*[data-jsx="123"] {color: blue;}[href="woot"][data-jsx="123"] {color: red;}p[data-jsx="123"] a[data-jsx="123"] span[data-jsx="123"] {color: red;}p[data-jsx="123"] span {background: blue}p[data-jsx="123"] a[title="'w ' ' t'"][data-jsx="123"] {margin: auto}p[data-jsx="123"] span:not(.test) {color: green}p[data-jsx="123"],h1[data-jsx="123"] {color: blue;-webkit-animation:a123hahaha 3s ease forwards infinite;-moz-animation:a123hahaha 3s ease forwards infinite;animation:a123hahaha 3s ease forwards infinite;-webkit-animation-name:a123hahaha;-moz-animation-name:a123hahaha;animation-name:a123hahaha;-webkit-animation-delay:100ms;-moz-animation-delay:100ms;animation-delay:100ms;}p[data-jsx="123"]:hover {color: red;}p[data-jsx="123"]::before {color: red;}[data-jsx="123"]:hover {color: red;}[data-jsx="123"]::before {color: red;}[data-jsx="123"]:hover p[data-jsx="123"] {color: red;}p[data-jsx="123"] + a[data-jsx="123"] {color: red;}p[data-jsx="123"] ~ a[data-jsx="123"] {color: red;}p[data-jsx="123"] > a[data-jsx="123"] {color: red;}p[data-jsx="123"] >> a[data-jsx="123"] {color: red;}@-webkit-keyframes a123hahaha {from { top: 0 }to { top: 100 }}@-moz-keyframes a123hahaha {from { top: 0 }to { top: 100 }}@keyframes a123hahaha {from { top: 0 }to { top: 100 }}@media (min-width: 500px) {.test[data-jsx="123"] {color: red;}}.test[data-jsx="123"] {display: block;}