Skip to content

[css-navigation-1] Simplify @navigation matching between two pages, regardless of direction #13199

@bramus

Description

@bramus

An example currently in the spec is the following:

@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 #13179 (comment).

Can we simplify this scenario?

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

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

Or something else?

/cc @dbaron @noamr

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    FTF agenda items

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions