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.

-- 
GitHub Notification of comment by bramus
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8925#issuecomment-1591149954 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 12:54:51 UTC