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

When I first encountered this thread, my first thought was that I hoped that the CSSWG would consider using `@module` instead of `@sheet` as its term.
* This was because “sheets” also has a meaning in several user-interface design areas:
     * [Sheets in macOS, iOS, etc.](https://developer.apple.com/design/human-interface-guidelines/sheets)
     * [Bottom sheets in Android](https://developer.android.com/develop/ui/compose/components/bottom-sheets)
     * [Bottom sheets in Google Material Design](https://m3.material.io/components/bottom-sheets/guidelines)
* It’s true that “stylesheet” has been a [term of art since SGML for over forty years](https://web.archive.org/web/20060906211843/https://people.opera.com/howcome/2006/phd/).
   * But it’s possible that HTML or CSS could eventually add standard functionality for such UI sheets in the future in its dialog or popover systems. Having a `@sheet` rule might be confusing at the same time.

However, after reading https://github.com/w3c/csswg-drafts/issues/11509#issuecomment-2650179181, I know now that, currently, the “`@sheet` proposal is equivalent to **importing a specific export from a script**”.
* `@module` wouldn’t work for this mental model, and there’s probably not a better term for “an export of a CSS module” than `@sheet`.
* This situation does make me wonder if it’s worth proposing ES submodules for JavaScript in TC39.
    * [In 2011, inline module declarations were proposed for ES Harmony Modules](https://web.archive.org/web/20160203104148/wiki.ecmascript.org/doku.php?id=harmony%3Amodules) at one point.
    * See also a [2020 proposal for anonymous inline ES modules](https://gist.github.com/littledan/f7c1d1abf0e51ad4b526a8eadb2da43b) from @littledan.
    * Of course, inline ES modules would face similar problems as `@import` in `@sheet`; see MicrosoftEdge/MSEdgeExplainers#936.

The only question I have left about `@sheet` itself is how it can align more with Declarative CSS Modules and [Declarative Shadow DOM Style Sharing](https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/ShadowDOM/explainer.md).
* This seems uncertain especially given that the Edge explainers say that “we'll be prioritizing only one of these two [three?] in the immediate future”.


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


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

Received on Saturday, 5 April 2025 19:38:03 UTC