Re: [csswg-drafts] [css-view-transitions-2] Creating 'classes' of transition groups (#8319)

> I wouldn't call `header > *` or `nav > a` or even section:has(a:active) an uncommon use-case. 

Agreed. I was talking more specifically about cases where you don't have access to markup and only have access to CSS as being the uncommon use-case. I think a lot of devs use `header > *` or `nav > a` for convenience and not because they can't change the HTML.

---

There are clearly a bunch of intricacies here, so I want to say that anything we discussed would be a huge improvement and overall acceptable. Even this:

```css
.box {
  view-transition-class: box;
}
::view-transition-group(* of box) {
  ...
}
```

----

The problem at the moment is that 
- transition names need to be unique
  - So it usually makes sense to generate them (with `useId` in React for example)
  - This means `::view-transition-group` styles can't be defined statically

The `view-transition-class` property would solve the problem. 

----

I think based on the  discussion above, it is clear that `view-transition-class` property will always be needed for some use-cases, so the argument can be made that we should choose just one more flexible way to do things, rather than adding a bunch of APIs for convenience.

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


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

Received on Monday, 11 December 2023 00:07:35 UTC