Skip to content

Commit

Permalink
Removes morph animations when setting transition:animate=none (#10247)
Browse files Browse the repository at this point in the history
* Removes morph animations when setting transition:animate=none

* Apply suggestions from code review

---------

Co-authored-by: Arsh <[email protected]>
  • Loading branch information
martrapp and lilnasy authored Feb 27, 2024
1 parent 08cdd09 commit fb773c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/eight-shrimps-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"astro": patch
---

Fixes an issue where `<ViewTransitions transition:animate="none" />` still allowed the browser-native morph animation.
1 change: 1 addition & 0 deletions packages/astro/src/runtime/server/transition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>`));
Expand Down

0 comments on commit fb773c9

Please sign in to comment.