[csswg-drafts] [css-navigation] Concerns about `at` navigation rules creating CSS bloat (#13117)

noamr has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-navigation] Concerns about `at` navigation rules creating CSS bloat ==
This was voiced by @matthewp [here](https://github.com/w3c/csswg-drafts/issues/12594#issuecomment-3533843013).

Copying some of the comments, but please feel free to reword in any way you like @matthewp.

> 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?
> 
> ----
> 
> Edit: just tested and disabling `<style>` via `style.disabled = true` actually does prevent the styles from applying, i had no idea. This re-enforces my belief that this proposal encourages bloating CSS into fewer files for convenience over user experience. 

 _Originally posted by @matthewp in [#12594](https://github.com/w3c/csswg-drafts/issues/12594#issuecomment-3532894624)_

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13117 using your GitHub account


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

Received on Tuesday, 18 November 2025 14:15:13 UTC