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

I don't really like the idea of having extra syntax here specifically for view transitions.
I also don't like that selectors then suddenly have side effects.

```css
section[--id: id] img.thumbnail {
    view-transition-name: "thumb-" var(--id);
}
```

could be :

```css
section[id]:has(img.thumbnail) {
    --id: attr(id);
}

section[id] img.thumbnail {
    view-transition-name: "thumb-" var(--id);
}
```

------

<details>
<summary>sidetrack</summary>

I also can't help but feel that user should be able to use the full selector syntax to select view transition pseudo elements and that we are coming at this from the wrong angle.

As I see it we actually want to have classes, attributes and id's on pseudo elements which is not possible because authors can add these in markdown.

But what if we allow authors to push this information onto them?

```css
/* ignore the exact naming and syntax */
.foo {
    view-transition-id: "something-unqiue";
    view-transition-class: "class-a" "class-b" "class-d";
    view-transition-attributes: ["foo" "bar"] ["fooz" "baz"]
}
```
</details>

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


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

Received on Tuesday, 9 April 2024 08:51:03 UTC