-
Notifications
You must be signed in to change notification settings - Fork 47.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add example using View Transition Classes and CSS Modules
I did have to rename my classes because there's a bug where generated CSS Module class names can have the `+` character in them which is invalid for View Transition Class Names.
- Loading branch information
1 parent
f4b7bbc
commit 8b91b37
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
fixtures/view-transition/src/components/Transitions.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@keyframes enter-slide-right { | ||
0% { | ||
opacity: 0; | ||
translate: -200px 0; | ||
} | ||
100% { | ||
opacity: 1; | ||
translate: 0 0; | ||
} | ||
} | ||
|
||
@keyframes exit-slide-left { | ||
0% { | ||
opacity: 1; | ||
translate: 0 0; | ||
} | ||
100% { | ||
opacity: 0; | ||
translate: 200px 0; | ||
} | ||
} | ||
|
||
::view-transition-new(.enter-slide-right):only-child { | ||
animation: enter-slide-right ease-in 0.25s; | ||
} | ||
::view-transition-old(.exit-slide-left):only-child { | ||
animation: exit-slide-left ease-in 0.25s; | ||
} |