Repository navigation
Closed
Labels
from: MicrosoftProposed, edited, or co-edited by Microsoft.position: supporttopic: javascriptSpec relates to the JavaScript programming languagetopic: loadingvenue: WHATWG HTML Workstream
Description
Request for position on an emerging web specification
Implement CSS module scripts
- WebKittens who can provide input:
Information about the spec
- Spec Title: CSS module scripts
- Spec URL: https://html.spec.whatwg.org/multipage/webappapis.html#creating-a-css-module-script
- GitHub repository: Introduce CSS Module Script whatwg/html#4898
- Issue Tracker (if not the repository's issue tracker):
- Explainer (if not README.md in the repository): https://github.com/WICG/webcomponents/blob/gh-pages/proposals/css-modules-v1-explainer.md
Design reviews and vendor positions
- TAG Design Review:
- Mozilla standards-positions issue:
Bugs tracking this feature
- WebKit Bugzilla: https://bugs.webkit.org/show_bug.cgi?id=227967
- Radar:
Anything else we need to know
The CSS module scripts feature has been merged into the HTML spec.
Reacted by Benny Powers, Abdón Rodríguez, Justin Fagnani, Oliver Williams, JingAn Chen, mangelozzi, Owen Buckley, Jochen Kühner, Casey, Matías Juarez and 1 more
Reacted by Owen Buckley
Metadata
Metadata
Labels
from: MicrosoftProposed, edited, or co-edited by Microsoft.position: supporttopic: javascriptSpec relates to the JavaScript programming languagetopic: loadingvenue: WHATWG HTML Workstream
Type
Projects
- StatusShow more project fieldsDone
Activity
annevk commentedon Oct 25, 2022
Adding
concerns: integrationdue to whatwg/html#7233 still existing.uasan commentedon Feb 2, 2023
The importance of this implementation lies in the fact that now it is impossible to make a polyfill, because importing
{ type: "css" }causes a syntax error, this means that you need to respond different JS source code on the server depending on the browserannevk commentedon Feb 6, 2023
Note that as per references in #128 the underlying syntax is likely to change here.
clshortfuse commentedon Feb 16, 2023
From a developer perspective I'm transcompiling imports into a constructable
CSSStyleSheetfor Firefox.On Safari (non TP), I put it into a
HTMLStyleSheetand pass the childCSSStyleSheetthat's still attached. Before adding a CSSStyleSheet to a ShadowDOM (Web Components), theCSSStyleSheetis inspected and the parentHTMLStyleSheetgets cloned. I imagine if/when constructableCSSStyleSheets is out ot TP, I'll be able to reduce some code, but still would need transcompilation.I hope it gets implemented, but not entirely important for production since we package imports before deployment. For development, we'd have 0 transcompile which means we can work directly against files on the drive instead of minified (
FormAssociatedis/was our only polyfill). That can be rather useful for live-editing styles within the browser (easier than source maps). We do not expect to move back to SCSS, or author CSS within JS.annevk commentedon May 12, 2023
This would be "position: support" if #77 (comment) were addressed. Marking this blocked for now.
uasan commentedon Sep 7, 2023
@annevk As I understand it, this commit should unblock this task?
Enable import-attributes - WebKit/WebKit@587c5d4
annevk commentedon Oct 29, 2023
As #77 (comment) has been resolved (thanks Nicolò!) and no other concerns have been raised I suggest we mark this "position: support" one week from now.