Skip to content
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

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

Closed
bramus opened this issue Jan 18, 2024 · 4 comments · Fixed by #9924
Closed

Comments

@bramus
Copy link
Contributor

bramus commented Jan 18, 2024

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.

@bramus bramus added the css-view-transitions-1 View Transitions; Bugs only label Jan 18, 2024
@vmpstr vmpstr added the Async Resolution: Proposed Candidate for auto-resolve with stated time limit label Jan 29, 2024
@astearns
Copy link
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?

@noamr
Copy link
Collaborator

noamr commented Jan 30, 2024

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.

@astearns
Copy link
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

@astearns astearns added Async Resolution: Call For Consensus Resolution will be called after time limit expires and removed Agenda+ Async Resolution: Proposed Candidate for auto-resolve with stated time limit labels Jan 31, 2024
@astearns
Copy link
Member

astearns commented Feb 7, 2024

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

@astearns astearns added Needs Edits Needs Testcase (WPT) and removed Async Resolution: Call For Consensus Resolution will be called after time limit expires labels Feb 7, 2024
noamr added a commit to noamr/csswg-drafts that referenced this issue Feb 8, 2024
khushalsagar added a commit that referenced this issue Feb 8, 2024
…tion-delay in vt pseudo-elements (#9924)

* Inherit to the UA stylesheet rules for (::view-transition) -image-pair, -old, and -new

Closes #9817

* Update css-view-transitions-1/Overview.bs

---------

Co-authored-by: Khushal Sagar <63884798+khushalsagar@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants