fix: Allow to disable animation prefix ()

* fix: Allow to disable animation prefix

* Apply suggestions from code review

---------

Co-authored-by: Paolo Ricciuti <ricciutipaolo@gmail.com>
pull/14825/head
Andrey Sitnik 4 months ago committed by GitHub
parent 1d773ef3a4
commit 38a3ae321f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: don't include keyframes in global scope in the keyframes to rename

@ -28,11 +28,19 @@ function is_global_block_selector(simple_selector) {
);
}
/**
*
* @param {Array<AST.CSS.Node>} path
*/
function is_in_global_block(path) {
return path.some((node) => node.type === 'Rule' && node.metadata.is_global_block);
}
/** @type {CssVisitors} */
const css_visitors = {
Atrule(node, context) {
if (is_keyframes_node(node)) {
if (!node.prelude.startsWith('-global-')) {
if (!node.prelude.startsWith('-global-') && !is_in_global_block(context.path)) {
context.state.keyframes.push(node.prelude);
}
}

@ -74,6 +74,10 @@
animation: svelte-xyz-test 1s;
}
.y{
animation: test-in 1s;
}
@keyframes test-in{
to{
opacity: 1;

@ -76,6 +76,10 @@
animation: test 1s;
}
.y{
animation: test-in 1s;
}
@keyframes test-in{
to{
opacity: 1;

Loading…
Cancel
Save