Hi WebKit-dev,

 

I'd like to ask for WebKit's official position on CSS Module Scripts, as described in the explainer at [1]. This proposal allows developers to import a CSSStyleSheet using the same import mechanism as JavaScript Modules:

import styleSheet from "./styles.css" assert { type: "css" };

The proposal has already been in discussion for a while now (long thread at [2], see also the TAG review [3]), but I think it would be useful to have WebKit’s official position on it. Note that use of CSS modules will now require a type: “css” import assertion [4] to prevent the MIME type security issue raised at TPAC 2019 [5].

The CSS Module Script HTML Spec PR is at [6], and is currently blocked on resolution of an open issue [7] in the import assertions TC39 proposal. However import assertions is at Stage 3 so that proposal is unlikely to undergo significant changes.  

 

[1] Explainer: https://github.com/WICG/webcomponents/blob/gh-pages/proposals/css-modules-v1-explainer.md

[2] Discussion Thread: https://github.com/WICG/webcomponents/issues/759

[3] TAG review: https://github.com/w3ctag/design-reviews/issues/405

[4] Import Assertions: https://github.com/tc39/proposal-import-assertions

[5] MIME type security issue: https://github.com/w3c/webcomponents/issues/839

[6] HTML Spec PR: https://github.com/w3ctag/design-reviews/issues/405

[7] Import Assertions host integration issue: https://github.com/tc39/proposal-import-assertions/pull/111

 

Thanks,

Dan Clark

Microsoft Edge