-
Notifications
You must be signed in to change notification settings - Fork 636
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
[css-transitions-2] Should we make @starting-style
resource-loading aware?
#9967
Comments
I think state pseudo classes would be better. You could combine that with Both spec and implementation based on special-casing |
Is there already a state pseudo-class which activates if the resource associated with the element is fully loaded? I'm also not sure how to reason about the load state for images because you have animated images (GIFs) and progressively loaded images where the content is still streaming in but you do want to start fading in sooner than full load. |
No, I was referring to issue #7467 that @bramus mentioned.
I don't know, but the that's a relevant discussion both for a pseudo class and for baking that behavior into |
Agreed that the loaded state should be reflected in a pseudo-class. So you could make the image visible only after it has loaded and probably use a CSS transition to do a fade-in or any other effect. |
Seems like we’re all convinced the pseudo classes are a better solution here … Closing. |
With CSS
@starting-style
you can determine the starting styles. I noticed that for images these are respected, but it only has the wanted visual outcome when the image is readily available - i.e. when loaded from cache.For images that still need to be loaded first, the visual outcome is different: while the
@starting-style
is respected, authors would want these to only run once the image has been loaded.Demo: https://codepen.io/bramus/pen/yLwZOqQ
starting-style-on-images.mp4
A more practical use-case would be a view transition that grows an image on the old page to a full-size image. The author can show a placeholder where the new image would be and have that fade-in once it’s been loaded. This would work there because the new snapshot is a live snapshot.
So, question is: should we make
@starting-style
on certain elements loading aware? Images? Videos? Iframes?(Seeing overlap with #7467 here …)
The text was updated successfully, but these errors were encountered: