0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-06 22:10:10 -05:00

Removes morph animations when setting transition:animate=none (#10247)

* Removes morph animations when setting transition:animate=none

* Apply suggestions from code review

---------

Co-authored-by: Arsh <69170106+lilnasy@users.noreply.github.com>
This commit is contained in:
Martin Trapp 2024-02-27 18:16:32 +01:00 committed by GitHub
parent 08cdd0919d
commit fb773c9161
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View file

@ -0,0 +1,5 @@
---
"astro": patch
---
Fixes an issue where `<ViewTransitions transition:animate="none" />` still allowed the browser-native morph animation.

View file

@ -107,6 +107,7 @@ export function renderTransition(
sheet.addFallback('old', 'animation: none; mix-blend-mode: normal;');
sheet.addModern('old', 'animation: none; opacity: 0; mix-blend-mode: normal;');
sheet.addAnimationRaw('new', 'animation: none; mix-blend-mode: normal;');
sheet.addModern('group', 'animation: none');
}
result._metadata.extraHead.push(markHTMLString(`<style>${sheet.toString()}</style>`));