Re: [csswg-drafts] [css-view-transitions-2] Syntax for navigation-matching (#8925)

> Yeah, that might be nice and forward-looking.
> 
> ```js
> document.startViewTransition({
>   urls,
>   update() {
>     // update DOM here
>   }
> });
> ```
> 
> Where `urls` can be:
> 
> * `undefined` - default, don't do anything with the media queries
> * `"auto"` - pick up the URLs automatically
> * `{ old, new }` - the URLs. If either are left undefined, then they're picked up automatically.
> 
> Maybe that's a bit of a weird API shape, since `{}` would be equivalent to `"auto"`. But I like the idea.

In general I like the idea of `callback | {callback, ...}`.
I'm not sure we need `undefined` though. If you don't want to deal with URLs, don't define `@navigation` rules / media-queries.

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


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

Received on Thursday, 8 June 2023 14:12:21 UTC