Re: [csswg-drafts] [css-view-transitions-2][css-conditionals] Exposing navigation/route matching (#12594)

@noamr is this change targeting SPAs then? An MPA can split CSS by route by putting the CSS into different files, ala `page-one.css`, `page-two.css`, `shared.css`.

For SPAs you can still split into separate files (and should!) but you might need to protect against unwanted styling by doing something like:

__page-one.css__

```css
body[page=one] {
  /* ... */
}
```

__page-two.css__

```css
body[page=two] {
  /* ... */
}
```

The major downside of this is the need to nest a bunch of CSS, but this proposal does not improve on that, so what is the advantage really?

-- 
GitHub Notification of comment by matthewp
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12594#issuecomment-3532894624 using your GitHub account


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

Received on Friday, 14 November 2025 13:48:22 UTC