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

> Picking out only a detail from earlier in this thread:
> 
> ```css
> @navigation prev-slide {
>   target: urlpattern(/slide1);
>   type: navigate, back-forward;  
> }
> 
> @navigation next-slide {
>   target: urlpattern(/slide3);
>   type: navigate, back-forward;  
> }
> ```
> 
> As an author, that would mean I need to write extra CSS for each and every page that my website holds. A snippet for page 1, page 2, page 3, …, page N. While this is easily possible to generate when using an SPA or some server side scripting language, not all sites have a build step and can just be static HTML.
> 
> Ideally, to me, there’d be some way to flag the directionality from within the markup as well, or at least have a way to provide a clue from the markup to the CSS. One of the earlier ideas floated _(in some other thread that I can’t find back)_ was to expose the navigation initiator somehow. For example, if the CSS somehow knew the users clicked `a#previous-page` to start the navigation, it could use that info to determine that it’s a backwards type of animation that needs to be done.

I wouldn't use the link for this, perhaps you have both a "back" and a "jump to slide 2"?
If we really wanted to support this use case in the web platform I would do something like define an order between the pages when declaring them and use that as an extra semantic in the media-queries. But I think this might be too niche, specifically for slideshow-style things, and perhaps it's easy enough to generate this from SCSS/some server framework?

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


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

Received on Wednesday, 14 June 2023 13:00:51 UTC