w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.38k stars 643 forks source link

[css-view-transitions-2] Declarative view transitions for same-document navigations. #8300

Open khushalsagar opened 1 year ago

khushalsagar commented 1 year ago

Cross-document same-origin transitions build on the idea of View transitions being implicitly triggered by a navigation. While it's obvious that this should be done for cross-document navigations, authors could use the declarative transition for same-document navigations involving a hash change as well.

This can be made configurable with the declarative opt-in we decide in #8048.

jakearchibald commented 1 year ago

If we do this, it should be an opt-in on top of the general opt-in we decide in https://github.com/w3c/csswg-drafts/issues/8048.

If the change is scroll position, then scroll-behavior: smooth already provides an animated transition that communicates the change, and we shouldn't hijack that unless it's really what the developer wants.

Changes that aren't scroll-related, but still don't depend on JS, are much rarer.