Skip to content

Commit

Permalink
Merge pull request #3229 from pynnl/gh-3228
Browse files Browse the repository at this point in the history
Fix global keyframes with no elements
  • Loading branch information
Rich-Harris authored Jul 23, 2019
2 parents 6cba41d + c33e4be commit be30a4c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/compiler/compile/css/Stylesheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ class Atrule {
if (type === 'Identifier') {
if (name.startsWith('-global-')) {
code.remove(start, start + 8);
this.children.forEach((rule: Rule) => {
rule.selectors.forEach(selector => {
selector.used = true;
});
});
} else {
code.overwrite(start, end, keyframes.get(name));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@keyframes why{0%{color:red}100%{color:blue}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<style>
@keyframes -global-why {
0% { color: red; }
100% { color: blue; }
}
</style>

0 comments on commit be30a4c

Please sign in to comment.