Skip to content

[css-view-transitions-2] Access to custom properties from within the pseudos #11153

@bramus

Description

@bramus

Something I see a lot of authors try to do – and fail at – is access custom properties of the original element from within the ::view-transition-* pseudos. See https://frontendmasters.com/blog/view-transitions-staggering/#but-does-that-actually-help-us for a recent example of this.

#items > * {
  view-transition-class: item;
  --index: sibling-index();
}

::view-transition-group(*.item) {
  animation-delay: calc(var(--index) * 0.02s);
}

Maybe we can have the ::view-transition-group pseudo gain access to the custom properties from the original element somehow?

Maybe by copying over the custom props in layered capture mode (which I can imagine would be slow when there are a ton of custom properties)?

Or maybe by defining their lookup mechanism (cfr. highlight pseudos), which I guess would be faster?

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