Skip to content

Commit be30a4c

Browse files
authored
Merge pull request #3229 from pynnl/gh-3228
Fix global keyframes with no elements
2 parents 6cba41d + c33e4be commit be30a4c

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

src/compiler/compile/css/Stylesheet.ts

+5
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,11 @@ class Atrule {
217217
if (type === 'Identifier') {
218218
if (name.startsWith('-global-')) {
219219
code.remove(start, start + 8);
220+
this.children.forEach((rule: Rule) => {
221+
rule.selectors.forEach(selector => {
222+
selector.used = true;
223+
});
224+
});
220225
} else {
221226
code.overwrite(start, end, keyframes.get(name));
222227
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@keyframes why{0%{color:red}100%{color:blue}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<style>
2+
@keyframes -global-why {
3+
0% { color: red; }
4+
100% { color: blue; }
5+
}
6+
</style>

0 commit comments

Comments
 (0)