View Transitions: able to be off-by-default (rather than fade) and enable per-element? #633
JoshuaKGoldberg
started this conversation in
Proposal
Replies: 2 comments
-
This can be accomplished by adding the following declaration to your CSS: ::view-transition-group(root) {
animation: none;
} It might be worth adding this to the |
Beta Was this translation helpful? Give feedback.
0 replies
-
We've been talking about this. Might be a good default to change to. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
Can we have first-class Astro support for View Transitions API that defaults to no animation, rather than
"fade"
?Background & Motivation
I just enabled
<ViewTransitions />
in the shared<head>
component of my site, and it works great - pages fade very smoothly on navigation. Awesome job!But, I don't want to have the fade animation on the entire page. I'd like to have it only apply to specific elements, and have a more traditional swap for everything else.
It doesn't seem like
<ViewTransitions />
has an option for setting to"none"
(or an equivalent) by default instead of"fade"
. But if I don't include<ViewTransitions />
in my page, then no Astro transitions in the page work at all. Am I missing something?Edit: I should also note that fading is the default (see the MDN View Transition docs for a primer). So perhaps this request is really for more seamlessly customizing the default/root transition?
Goals
Either:
Example
Edit: or...
Beta Was this translation helpful? Give feedback.
All reactions