[csswg-drafts] [css-navigation-1] Simplify `@navigation` matching between two pages, regardless of direction (#13199)

bramus has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-navigation-1] Simplify `@navigation` matching between two pages, regardless of direction ==
An example currently in the spec is the following:

```css
@route --search-results-page {
  pattern: url-pattern("/search-results");
}
@route --product-page {
  pattern: url-pattern("/product/:id");
}

@navigation ((from: --search-results-page) and
             (to: --product-page)) or
            ((from: --product-page) and
             (to: --search-results-page)) {
  /* These styles apply when a navigation is in progress
     between a search results page and a product page (as
     defined by the @route rules above), in either
     direction. */
}
```

The `@navigation` query there matches navigations between `--search-results-page` and `--product-page`, regardless of its direction.

This has a bit of a smell to it, and was also brought up in https://github.com/w3c/csswg-drafts/issues/13179#issuecomment-3603136681.

Can we simplify this scenario?

Maybe by introducing `between` as a `<navigation-location-keyword>`?

```css
@navigation (between: --search-results-page, --product-page) {
  /* … */
}
```

Or something else?

/cc @dbaron @noamr 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13199 using your GitHub account


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

Received on Wednesday, 10 December 2025 09:28:19 UTC