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

To show the net effect the proposed addition of `ident()`+`attr()` will have on authors I have created comparison demos:

1. Current way of naming multiple things: https://codepen.io/bramus/pen/xxmozvN
2. Proposed way of automatically naming multiple things with `ident()` and `attr()`: https://codepen.io/bramus/pen/PogVZwb

_(The second demo includes a rough polyfill to make it actually work. For best effect use Chrome Canary as these demos also use `view-transition-class`)_

I was able to remove 100 LOC in the second demo and can now change markup (i.e. add / remove items) without needing to worry about the CSS.

Using `view-transition-name: auto` would not have worked here as I am doing the title transition between two different elements (from the `h2` to a `span` or back, depending on the checked state of the `input`).



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


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

Received on Wednesday, 24 April 2024 08:39:51 UTC