A comparison of two CSS approaches for assigning view-transition-name values: the advanced attr() function and the newer match-element keyword. While both work for same-document view transitions, match-element has two key limitations — it doesn't work across MPA (multi-page app) navigations because element identity differs between documents, and it can't be used to uniquely target specific elements in ::view-transition-*() selectors. The attr() approach is more flexible when either of those scenarios applies.
Table of contents
view-transition-name: attr(…);view-transition-name: match-element;match-element works … until it doesn’t7.3K Impressions1 Comment