Re: [csswg-drafts] Proposal: CSS @sheet (#11509)

There are definitely uses for `@sheet` outside of Shadow DOM. Being able to define a `layer` or [`scope`](https://github.com/w3c/csswg-drafts/issues/7348) or media query or `@supports` for styles where they're imported, rather than only where they're defined, is useful for code organisation. Having a CSS bundler combine CSS files together, and then using native CSS `@import` without the current performance drawbacks sounds great. 

@romainmenke Isn't your example conflating how you might author styles and how a CSS bundler might bundle them? Seeing as the purpose of `@sheet` is to improve performance by reducing requests, it seems non-optimal? 

```css
@sheet foo {
  @import "bar.css";
}
```

But perhaps an `@import` statement within a `@sheet` could import a different sheet defined within the same file? 

-- 
GitHub Notification of comment by o-t-w
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11509#issuecomment-2906851822 using your GitHub account


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

Received on Saturday, 24 May 2025 14:10:44 UTC