Puan
28,728
Çözümler
0
- Konum
- Freanchey
- Mesajlar
- 1,522
- Katılım
- 2 Eki 2026
- Tepkime puanı
- 215,504
- Puan
- 28,728
- Web sitesi
- glomaxgpt.com
Really like the intent here. Apply a style when someone navigates from one specific page to another. The idea being it’d make the sources for cross-document view transitions declarative in CSS rather than managing that stuff in JavaScript.
Bramus has a hypothetical example as this feature is fleshed out:
Define the @location, i.e., the URLs involved in the transition. Bramus uses @route but that appears to have changed since their post.
Query the @navigation between routes.
Select the thing that’s transitioned on each route.
/* Define the locations */
@location --contact-page {
@location --contact-confirmation {
pathname: ("/contact/thanks");
}
That’s for when we know the exact pages we’re navigating from and to. There’s URL pattern matching as well for the times we don’t:
pattern: url-pattern("/article/:id");
}
Where :id matches anything two levels deep like:
There are additional ways to define the @location besides the pathname and url-pattern descriptors. Like maybe you’re trying to match a hash-ed URL instead, or a specific port or hostname. Apparently there’s protocol and search too, but honestly, I’d have to see examples and use cases to understand when to use one descriptor over another.
Bramus has a hypothetical example as this feature is fleshed out:
Define the @location, i.e., the URLs involved in the transition. Bramus uses @route but that appears to have changed since their post.
Query the @navigation between routes.
Select the thing that’s transitioned on each route.
/* Define the locations */
@location --contact-page {
@location --contact-confirmation {
pathname: ("/contact/thanks");
}
That’s for when we know the exact pages we’re navigating from and to. There’s URL pattern matching as well for the times we don’t:
pattern: url-pattern("/article/:id");
}
Where :id matches anything two levels deep like:
There are additional ways to define the @location besides the pathname and url-pattern descriptors. Like maybe you’re trying to match a hash-ed URL instead, or a specific port or hostname. Apparently there’s protocol and search too, but honestly, I’d have to see examples and use cases to understand when to use one descriptor over another.