Re: [csswg-drafts] [css-view-transitions-2] view-transition-name determined by element (#8320)

One issue with that syntax is it allows you to capture an attribute named n from only one element in the chain. As in, you can't do: `.one[@foo] .two[@foo]`, because now you have two `@foo` and no way to differentiate them.

I don't like the naming/syntax here, but you could do something like:

```css
:capture-for-attr(.one, 'one') :capture-for-attr(.two, 'two') {
  view-transition-name: captured-attr('one', 'foo') captured-attr('two', 'foo');
}
```

`:capture-for-attr(selector, name)` - where `selector` is processes as normal, but the selected element is stored as `name`.

`captured-attr(name, attribute)` - like `attr()`, but the first arg is the `name` of something captured earlier in the selector.

This all feels very complicated though.

-- 
GitHub Notification of comment by jakearchibald
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8320#issuecomment-1878449550 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 5 January 2024 10:28:40 UTC