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

> > I'm in disagreement that having a separate page1.css and page2.css etc is a good performance practice for most cases and something that should be encouraged by the platform. See comment above.
> 
> I might have misunderstood your argument here, from the other thread it sounded like you are saying that you shouldn't do it because then you would have duplicate styles between `page1.css` and `page2.css` but that is not how anyone does it. In the example I provided I showed there being a `shared.css` which contains the shared CSS between the pages.

I'm saying that in general having a separate page-specific external CSS file is somewhat of a performance antipattern because it forces a fetch of something that could have been inlined in the page.

But regardless, authors today have multiple options to mix and match page-specific and shared styles. e.g.
```
html[data-page-type=home] {
}
```

I think this pattern in itself does not need to be encouraged or discouraged. It's good (performance-wise and otherwise) for some use cases, and bad if abused (e.g. if people use this pattern to create huge CSS files instead of splitting them by content).
But enabling this pattern without having to use JS to map between URLs and styles is a net win, also performance-wise.


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


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

Received on Wednesday, 3 December 2025 13:30:24 UTC