#1253: Other Spec Review: CSS navigation-based styling
Discussions
Log in to see TAG-private discussions.
Comment by @matatk Aug 12, 2026 (See Github)
Hi @noamr, thank you for the review request. I note the mention of accessible alternatives in the draft note in the spec. There isn't an 'accessibility considerations' section in the explainer or spec, though. Could you let us know your thoughts on accessibility? (If you could add such a section to the spec, or explainer, that'd be great.)
Comment by @noamr Aug 13, 2026 (See Github)
Hi @noamr, thank you for the review request. I note the mention of accessible alternatives in the draft note in the spec. There isn't an 'accessibility considerations' section in the explainer or spec, though. Could you let us know your thoughts on accessibility? (If you could add such a section to the spec, or explainer, that'd be great.)
This spec is adjacent to a few a11y features/considerations such as indicating the "current link" with aria-current, or indicating "loading" with aria-busy, but we don't see atm how these should impact the spec, if at all.
If TAG or anyone else thinks that there is some oversight around a11y, we'd love to hear!
Discussed
Aug 17, 2026 (See Github)
Dan: I have questions about how this works. Need more time to finish the review.
Matthew: Nothing specific I want to ask right now; am still thinking on it.
Discussed
Aug 31, 2026 (See Github)
Dan: I had some surface level questions (a couple of weeks ago) that maybe we should post; I am hoping to have more time to look in more detail and maybe come up with more comments.
Matthew: We did have a back-and-forth with them regarding a11y, right?
Dan: Yes.
Matthew: One of the goals that they state is how a user interface is changing if they interact with it. I’m a bit sensitive about if the user would understand that. If the visual design has a semantic relationship, that needs to be expressed. There are other ways to understand the UI. Visual cues/structural stuff/focus management that we need. Trying to make that transition more accessible by adding more metadata doesn’t seem like the right approach. Think we should keep the momentum going. Appreciate the additions that they’ve made.
Dan: I will post what we’ve got, and then we can look at it async.
Discussed
Sep 21, 2026 (See Github)
Dan: I posted some surface-level thoughts. One more-important question about cross-origin navigations. Want other thoughts, but can ask the clarifying questions. Matthew asked about accessibility, and Noam added an accessibility section. Would love your thoughts.
Matthew: I looked, and it doesn't render properly, but I think I get the gist. The spec states that the purpose of providing the transition animation is to make it easier to understand what's going on, and I'm wondering if there's anything semantic that needs to be conveyed that wouldn't be part of the structure of the page. I think there probably isn't. No major concerns or objections given their addition.
Lola: Think someone else should give this a once-or-twice-over. Not hearing volunteers. Please do look over Dan's comment.
Comment by @dandclark Sep 23, 2026 (See Github)
Thanks @noamr for posting this. I had some mostly surface-level comments/questions.
- Which aspects of the feature, if any, will function for cross-origin navigations? Is this intended to be a same-origin-only feature like view transitions or are there cross-origin use cases we should be thinking about?
- I think the non-react HTML example in https://github.com/WICG/declarative-partial-updates/blob/main/route-matching-explainer.md#framework-routers is missing have a
spinnerelement matching:active-navigation(to --home) + spinner { opacity: 100%; } - Every instance of
@locationshown in the explainer hasbase-url: document. It'd be helpful to show a case where it's useful to setbase-urlto something else. If this is not common, maybe that should be a default rather than something that needs to be specified in every@locationblock. - In general more examples would be helpful, especially examples of how this will be used together with view transitions.
- In https://github.com/WICG/declarative-partial-updates/blob/main/route-matching-explainer.md#url-matching, the code block has
from,to,between, andat, but the explanation after haswithinstead ofbetween. Which should be used here? The meaning ofbetweenseems self-explanatory but I'm not sure howwithoratshould be used even after reading the explanatory text a few times. - On https://github.com/WICG/declarative-partial-updates/blob/main/route-matching-explainer.md#navigation-type-matching, what's the difference between
@navigation (history: navigate) { ... }and@navigation (history: traverse) { ... }? In the spec https://drafts.csswg.org/css-navigation-1/#typedef-navigation-type-keyword only hastraverseso maybenavigateshouldn't be there? - The explainer has some formatting issues for example in https://github.com/WICG/declarative-partial-updates/blob/main/route-matching-explainer.md#link-matching and a few other places where there are literal
###which I think are meant to be subsection headers. - Is there a consistent way to define a
@locationrule that always matches "the current URL", outside of a navigation, without hardcoding any paths? That seems like it'd be useful e.g. in tandem witha:link-toso that any link that'd trigger a refresh is styled differently.
Comment by @noamr Sep 28, 2026 (See Github)
Thanks @noamr for posting this. I had some mostly surface-level comments/questions.
Thanks for the review! Are you planning to provide some more deeper opinion about the approach of providing navigation info directly to css? That would be the kind of review I was hoping for from TAG.
- Which aspects of the feature, if any, will function for cross-origin navigations? Is this intended to be a same-origin-only feature like view transitions or are there cross-origin use cases we should be thinking about?
This feature mirrors the navigation API, which fires events also for cross origin navs.
So yes, cross origin navigation can affect styling.
A use case can be styling links to a particular origin or showing an exit animation if a cross origin navigation is initiated.
- I think the non-react HTML example in https://github.com/WICG/declarative-partial-updates/blob/main/route-matching-explainer.md#framework-routers is missing have a
spinnerelement matching:active-navigation(to --home) + spinner { opacity: 100%; }
Thanks, will get that fixed!
- Every instance of
@locationshown in the explainer hasbase-url: document. It'd be helpful to show a case where it's useful to setbase-urlto something else. If this is not common, maybe that should be a default rather than something that needs to be specified in every@locationblock.
Yes, there are ongoing discussions about how base URL should work.
- In general more examples would be helpful, especially examples of how this will be used together with view transitions.
- In https://github.com/WICG/declarative-partial-updates/blob/main/route-matching-explainer.md#url-matching, the code block has
from,to,between, andat, but the explanation after haswithinstead ofbetween. Which should be used here? The meaning ofbetweenseems self-explanatory but I'm not sure howwithoratshould be used even after reading the explanatory text a few times.
Right, for now we are not specing 'with'. Cc @bramus for examples.
- On https://github.com/WICG/declarative-partial-updates/blob/main/route-matching-explainer.md#navigation-type-matching, what's the difference between
@navigation (history: navigate) { ... }and@navigation (history: traverse) { ... }? In the spec https://drafts.csswg.org/css-navigation-1/#typedef-navigation-type-keyword only hastraverseso maybenavigateshouldn't be there?
It felt like push/replace is not so much a styling concern but it's debatable.
- The explainer has some formatting issues for example in https://github.com/WICG/declarative-partial-updates/blob/main/route-matching-explainer.md#link-matching and a few other places where there are literal
###which I think are meant to be subsection headers.- Is there a consistent way to define a
@locationrule that always matches "the current URL", outside of a navigation, without hardcoding any paths? That seems like it'd be useful e.g. in tandem witha:link-toso that any link that'd trigger a refresh is styled differently.
That could be a good keyword to have.
OpenedAug 4, 2026
Specification
https://drafts.csswg.org/css-navigation-1
Explainer
https://github.com/WICG/declarative-partial-updates/blob/main/route-matching-explainer.md
Links
The specification
Where and by whom is the work is being done?
Feedback so far
You should also know that...
No response
<!-- Content below this is maintained by @w3c-tag-bot -->Track conversations at https://tag-github-bot.w3.org/gh/w3ctag/design-reviews/1253