Skip to content

[view-transitions-1] Have the -image-pair, -old, and -new pseudos inherit animation-delay #9817

Closed

Description

@bramus

I just caught myself doing this in a project I’m working on:

:root::view-transition-image-pair(*),
:root::view-transition-new(*),
:root::view-transition-old(*) {
  animation-delay: inherit;
}

I needed to do this to sync up the animation-delay from the ::view-transition-group(x) to its child-pseudos.

::root:view-transition-group(header) {
  animation-delay: 1s;
}

Without the first code snippet my animations were not in sync: the default fade-in/fade-out on the new/old pseudo ran at the wrong time.

I was surprised that animation-delay: inherit; on the pseudos isn’t part of the UA stylesheet VT styles, especially since the VT UA styles do exactly that for animation-duration (and animation-fill-mode):

/* UA Stylesheet (selection) */
:root::view-transition-group(*) {
  animation-duration: 0.25s;
}

:root::view-transition-image-pair(*) {
  animation-duration: inherit;
}

:root::view-transition-old(*),
:root::view-transition-new(*) {
  animation-duration: inherit;
}

I think it would be handy to include animation-delay: inherit for the -image-pair, -old, and -new pseudos in the UA stylesheet so that setting a delay on the -group automatically gets applied on the the child pseudos as well, keeping them all in sync.

Activity

  1. astearns commented on Jan 30, 2024

    @astearns
    Member

    I see animation-duration: inherit and animation-fill-mode: inherit already defined for these pseudos. Are there any other animation-* properties besides animation-delay that should also inherit here?

  2. noamr commented on Jan 30, 2024

    @noamr
    Collaborator

    I see animation-duration: inherit and animation-fill-mode: inherit already defined for these pseudos. Are there any other animation-* properties besides animation-delay that should also inherit here?

    It's clear that -delay needs to be inherited, but the other ones (direction, iteration-count) can go either way. We'd like to resolve on animation-delay only for now.

  3. astearns commented on Jan 31, 2024

    @astearns
    Member

    The CSSWG will automatically accept this resolution one week from now if no objections are raised here. Anyone can add an emoji to this comment to express support. If you do not support this resolution, please add a new comment.

    Proposed Resolution: Add animation-delay: inherit to the UA stylesheet rules for (::view-transition) -image-pair, -old, and -new

  4. astearns commented on Feb 7, 2024

    @astearns
    Member

    RESOLVED: Add animation-delay: inherit to the UA stylesheet rules for (::view-transition) -image-pair, -old, and -new

  5. added a commit that references this issue on Feb 8, 2024
    367c068
  6. added a commit that references this issue on Feb 8, 2024
    d1156bc
  7. nt1m commented on Jun 22, 2025

    @nt1m
    Member

    @noamr @vmpstr It looks like this resolution was never implemented in Chrome with no WPT written for it. (I've just received a WebKit bug report for it: https://bugs.webkit.org/show_bug.cgi?id=294812 ).

    cc @emilio who did properly implement it in Gecko however :)

  8. nt1m commented on Jun 22, 2025

    @nt1m
    Member

    There's a WPT for style inheritance that can probably just be expanded: css/css-view-transitions/style-inheritance.html

  9. nt1m commented on Jun 23, 2025

    @nt1m
    Member
  10. noamr commented on Jun 23, 2025

    @noamr
    Collaborator

    Seems to me like the implementation of this in chromium fell between the cracks... Probably the bot didn't create an issue because the label here doesn't start with [css-*] @vmpstr ?

  11. vmpstr commented on Jun 23, 2025

    @vmpstr
    Member

    The bot didn't parse Alan's uncommon resolved syntax :) I'll manually file an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions