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

1. Yes. 
2. Independent. While there _could_ be something interesting about additional work around `@import @sheet sheetName` in order to share across the single file, the goal is to keep the various `@sheet` entries separate from each other, but bound to the single file download.
3. Invalid. `@sheet` should be top level.
4. Invalid. `@sheet` should be top level.
5. CSS rules say last definition wins. JS rules say multiple `const`s throw errors. CSS doesn't really throw errors, so keep towards the CSS rules here.

1 and 4 in concert beg the question of what is returned at `import styles from './styles.css' assert { type: 'css' };` when the file does have `@sheet` specifiers? In the JS space, you'd hope for something more of an object with the other sheets on in `{ sheet1: CSSStyleSheet, sheet2: CSSStyleSheet, ...etc }`, however, I'd expect we'd need to actually accept a CSSStyleSheet with its `cssRules` array including `CSSStyleSheet`s, instead of rules. This could be a bit surprising to JS users, but clarifies the fact that 4 is not possible. If there were some magic way to get more of a JS import out of the the CSS assertion, it would be interesting to push for nested sheets to do the same, but both feel a bridge to far in a world where we'd actually want something like this to ship...

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


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

Received on Wednesday, 25 January 2023 20:49:05 UTC