Re: [csswg-drafts] [css-view-transitions-2] CSS only way to transition between list <-> detail views (#8209)

> First of all, this is a somewhat different use case, it's not related exactly to list<->details.

Agreed, going to a page other than the list page is a different use-case. I mentioned it because if we have a proposal which can solve this and the list use-case, we'd favour that over a proposal which only helps with the list use-case.

In the proposal below, the current Document needs to have link to the new Document in their html. It also looks like the presence of that link doesn't help narrow down which element to target. `body:has(link.details:next)` is equivalent to saying "if the user is navigating to this link". The browser back button is one example, I'm not sure if there will be others where authors are forced to add link elements just to use this CSS. Maybe that's ok.

```css
body:has(link.details:next) #maxiposter {
  view-transition: poster;
}
```

I'm evaluating this against the media query option:

```css
@media (next: urlpattern(...)) {
   #maxiposter { view-transition-name: poster; }
}
```

It seems like both would be functionally equivalent (do correct me if I'm missing a case). The media query one seems more ergonomic to me but I'd love dev feedback on that.

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


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

Received on Monday, 5 June 2023 19:15:00 UTC