Skip to content

Commit

Permalink
Apply fix for keyframes stripping required percent signs yui#80
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Hadfield committed Feb 9, 2016
1 parent 7372efd commit 2c79ffe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/com/yahoo/platform/yui/compressor/CssCompressor.java
Expand Up @@ -330,6 +330,7 @@ public void compress(Writer out, int linebreakpos)

// Replace 0(px,em,%) with 0.
css = css.replaceAll("(?i)(^|[^.0-9])(?:0?\\.)?0(?:px|em|%|in|cm|mm|pc|pt|ex|deg|g?rad|m?s|k?hz)", "$10");
css = css.replaceAll("(@[a-z\\-]*keyframe.*?)0\\{", "$10%{");
// Replace x.0(px,em,%) with x(px,em,%).
css = css.replaceAll("([0-9])\\.0(px|em|%|in|cm|mm|pc|pt|ex|deg|g?rad|m?s|k?hz| |;)", "$1$2");

Expand Down
4 changes: 4 additions & 0 deletions tests/keyframe.css
@@ -0,0 +1,4 @@
@keyframe anim {
0% { opacity: 0; }
100% { opacity: 1; }
}
1 change: 1 addition & 0 deletions tests/keyframe.css.min
@@ -0,0 +1 @@
@keyframe anim{0%{opacity:0}100%{opacity:1}}

0 comments on commit 2c79ffe

Please sign in to comment.