Re: [csswg-drafts] Multiple stylesheets per file (#5629)

> I have to disagree here, or at least advocate that CSS _should_ consider good JS integration as a goal on it's own.
> 
> There is a fundamental line in the dependency graph of many web projects from JS to CSS. JS modules require CSS to function properly, cause CSS to load, read values from CSS, and use those values to dynamically update HTML to trigger styling. So CSS adding features to make those types of things natively available and standard is a good thing. If `@sheet` (or `@export`) is initially used from JS, that's not bad, it's CSS offering one of it's main dependents a useful feature.

I think what many people (myself included) are reacting to is that there are valid use cases for this kind of modularization for CSS itself. Exporting and importing of CSS subresources is independently useful. JS is just one mechanism for this, but the web platform already has other mechanisms for importing CSS and any mechanism for exporting CSS subresources needs to integrate well with the existing mechanisms for importing CSS resources.

It’s not that JS integration doesn’t matter — the contrary. It’s that if we design a feature _only_ taking JS integration into account, we run the risk of later having to introduce a wholly new feature to address the CSS or HTML use cases, and having two separate features to solve the same types of use cases is a big antipattern.


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


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

Received on Tuesday, 27 January 2026 21:43:02 UTC