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

> How do you disable reloads or give them a different animation in this example?

Like I said, I'm not sure allowing transitions for reloads is a good idea. But, if we really wanted it, I'd make it part of the opt-in rule, and add a media query for it.

> It seems great when it's simple but when you want to tweak it you might end up with monstrous media-queries.

Can you give an example?

> Also, this is VT-specific. By having this as "navigations", you could style other things based on where you're coming from.

Maybe? But, making it work badly for VT because of some unknown non-VT use-case seems bad.

> Regarding having the URLs in the `startVT` function, sure, why not. I was thinking of something that would be declarative in advance, but putting this directly in `startVT` makes sense since it let's the SPA framework define what a navigation is.

Right, this is why I was asking you for an example, because I couldn't see how 'automatic' ways of doing it would fit in with the timing of same-document navigations and traversals.

> btw this is a push animation and not a slide animation.

Huh, I didn't realise there were official names for these types of animations. Where are they defined?

By 'slide' I was meaning that the new content slides in from the right (or left if it's 'back'), and the old content slides out to the left (or right if it's 'back'). But, the specific animation doesn't really matter, other than it's directional and between two specific pages.

> The thing with putting URL pattern in the media-query, is that if your routes change you have to update all of them, and you might have many. Sprinkling navigation routes all around CSS files seems brittle.

Agreed. When I said "I think I like the direction of this" I was referring to creating named definitions. I think that's a good idea.

Btw, I'm not saying the existing ideas I've summarised in various issues are perfect or even good, but they were thought-through, so they're a useful basis for comparison.

> I think I'm OK with keeping the rule but spelling-out the to/from both in the rule and in the `startVT` function (in the SPA case)

Yeah, I think exploring this further is a good idea. Just test it against basic examples, and ensure that it works for SPA too, so developers don't end up with multiple definitions for the same animation between two 'pages'.

If options are added to `startViewTransition`, I urge you to avoid the `functionName(bigCallback, options)` pattern. I think there's a path forward here, but it's novel https://github.com/whatwg/webidl/issues/1191

-- 
GitHub Notification of comment by jakearchibald
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8925#issuecomment-1582579787 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 13:26:23 UTC