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

> @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?

It might be sub-optimal, but in the case of 3d party resources it might still be the only available option:

```css
@sheet foo {
  @import url('https://fonts.googleapis.com/css?family=Roboto');
}
```

A bundler can't inline such resources.
The `foo` sheet itself might have been a separate file, containing the `@import` at the top and might have been bundled by a tool.

I just don't see any reason to disallow `@import` in `@sheet` when `@sheet` contents are supposed to mirror stylesheets written in separate files. Anything allowed in a `.css` file should be allowed in `@sheet` blocks for the bundler use case to be realizable without excessive constraints for CSS authors.

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


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

Received on Monday, 26 May 2025 06:58:54 UTC