Styling the navigation: declarative route and navigation matching in CSS

Title “Styling the Navigation: Declarative Route and Navigation Matching in CSS”, clay monster cards labeled “Zorp” and “Fluffy” with a hand cursor, and a @navigation code snippet.

Bramus Van Damme walks through a CSS Route and Navigation Matching proposal that lets you style navigation declaratively instead of wiring it up in JavaScript. It adds a @route rule to name routes with URL patterns, a @navigation rule to react to a navigation’s from and to, a :nav-source pseudo-class for the triggering element, and a :link-to() selector to style links by destination.

bram.us/2026/07/30/styling-the-navigation-declarative-route-and-navigation-matching-in-css