Skip to content

[css-view-transitions-1] Spec should not define web exposed keyframes #8887

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nt1m opened this issue May 31, 2023 · 5 comments
Closed

[css-view-transitions-1] Spec should not define web exposed keyframes #8887

nt1m opened this issue May 31, 2023 · 5 comments
Labels
css-view-transitions-1 View Transitions; Bugs only

Comments

@nt1m
Copy link
Member

nt1m commented May 31, 2023

https://drafts.csswg.org/css-view-transitions/#ua-styles defines 2 web exposed keyframes, I don't think the spec should do this, regardless of the prefix.

@nt1m nt1m added the css-view-transitions-1 View Transitions; Bugs only label May 31, 2023
@khushalsagar
Copy link
Member

Thanks for bringing this up! Just a heads up, this was last discussed on #7560 and would have relevant context.

The main use-case where we've found this useful is additive animations. Authors create effects which need a CSS animation on top of the UA defined one. For example, the UA will add a transform animation to move an element from its location in the old DOM to the location in the new DOM which has the keyframe name : -ua-view-transition-group-anim-target, where target is the view-transition-name on the 2 DOM elements. If an author wants to do a filter animation on top, they can simply add it by doing the following in their CSS:

::view-transition-group(target) {
   animation: -ua-view-transition-group-anim-target 1s, my-animation 1s;
}

The keyframe you linked above is static so its easy for authors to just write their own. But some UA keyframes generated for these elements are dynamic (depending on the size/position of the transitioning elements). And for those authors need to be able to refer the keyframe in their CSS for effects like these.

@argyleink @bramus FYI.

@khushalsagar
Copy link
Member

@nt1m does the above address the concerns you raised?

@annevk
Copy link
Member

annevk commented Jun 21, 2023

I looked through that other issue and it didn't have context as far as I can could tell:

<TabAtkins> Rossen_: Second, expose them to be usable in author stylesheets?
<TabAtkins> No opinion here
<TabAtkins> RESOLVED: The -ua- names *are* usable in author/user stylesheets.

It's a rather interesting choice to intrude on what was userland space before.

@khushalsagar
Copy link
Member

@annevk the comment thread on the issue itself touches upon some of the complexities associated with hiding this from authors:

  • What to do if author stylesheet declares the same keyframe name, which one applies. Do we have to carry around the source of the keyframe and style rule which sets the animation property.
  • How to hide this from script APIs that can read the keyframe name and keyframe values?

Interestingly, at the time we discussed #7560 we were only considering the awkwardness to handle the cases above. We didn't have a use-case where the author needed to refer to these keyframes in their stylesheet. As I mentioned in the comment above, now we've seen developers build transitions which need this to do additive animations.

Can you clarify the concerns with this approach?

@khushalsagar
Copy link
Member

I'm closing this issue but please feel free to re-open if there is any more feedback or suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-view-transitions-1 View Transitions; Bugs only
Projects
None yet
Development

No branches or pull requests

3 participants