Bug 227967
| Summary: | Implement CSS module scripts | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | daniec <daniec> |
| Component: | CSS | Assignee: | Kiet Ho <kiet.ho> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | 709922234, amir_mark, andseier, bannostookaylo, bogdan.arvinte, casey, cory, herr.ernst, incoming-webkitbugs, jeremiah, jochen.kuehner, kiet.ho, koddsson, koivisto, maxart.x, me, methanal, ncpncebij, owenbuckley13, philipprudloff, randy, simon.fraser, sn, tomac, webkit-bug-importer, webkit-bugzilla, webkit.bugzilla, westbrook.johnson, woodlxf00 |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: |
https://bugs.webkit.org/show_bug.cgi?id=222750 https://bugs.webkit.org/show_bug.cgi?id=326330 https://bugs.webkit.org/show_bug.cgi?id=326393 https://github.com/web-platform-tests/wpt/pull/63294 |
||
| Bug Depends on: | 322230, 323170, 323483 | ||
| Bug Blocks: | |||
daniec@microsoft.com
The CSS module scripts feature has been merged into the HTML spec.
Spec: https://html.spec.whatwg.org/multipage/webappapis.html#creating-a-css-module-script
Spec Integration PR: https://github.com/whatwg/html/pull/4898
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/80917329>
Westbrook
Now that the import attributes spec has re-advanced to stage 3 (https://tc39.es/proposal-import-attributes/), any thoughts on when we might see this work resourced?
jogibear9988
Chromestatus:
https://chromestatus.com/feature/5205869105250304
Firefox issue about import attributes:
https://bugzilla.mozilla.org/show_bug.cgi?id=1736059
Firefox issue about Module CSS Scripts:
https://bugzilla.mozilla.org/show_bug.cgi?id=1720570
bannostookaylo
Any updates on when this might be out? Sure would be nice to be able to use this in production apps as it makes things load really nicely in Chrome and Edge but I have to opt for less attractive and old techniques because of Safari.
bannostookaylo
Is there any kind of eta of releasing import with type CSS? Being able to import CSS would be a game changer. I know because I wrote my app with it but only tested with chrome like a noob. I had to revert everything to accommodate FF and Safari.
bannostookaylo
How's this going? Having the ability to confidently import CSS across browsers will be huge for browser development.
jogibear9988
FF will ship it in one of the next Versions: https://bugzilla.mozilla.org/show_bug.cgi?id=1720570#c10
Casey Klebba
It would be great to have some sort of signal on intent/desire to ship this capability, even if timing/priority is not known at this time — thanks for considering
Herman C. Enos
Any updates on this feature? It’s pretty crucial for the future of framework-free web apps.
Casey Klebba
Checking in on this thread for any new signs. Best I have found is an older thread which indicates support on 2023-11-14: https://github.com/WebKit/standards-positions/issues/77
Import attributes with {type: 'css'} availability:
Chrome 123 (Release date: 2024-03-19)
Firefox 147 (Release date: 2026-01-13)
https://webstatus.dev/features/css-modules
bannostookaylo
This currently works in Chrome, Firefox, Edge, and Opera, but fails in Safari due to what appears to be a WebKit-specific issue with CSS imports.
At the moment it’s difficult to justify adding browser-specific workarounds for Safari when the behavior diverges from every other major browser engine. Any clarification on whether this behavior is intentional or planned to be addressed would be appreciated.
Casey Klebba
For reference, here are all Interop request/rejection threads for CSS Module Scripts:
2026: CSS Module Scripts #1056 — https://github.com/web-platform-tests/interop/issues/1056
2025: CSS Module Scripts #703 — https://github.com/web-platform-tests/interop/issues/703
2024: CSS Module Scripts #597 — https://github.com/web-platform-tests/interop/issues/597
2023: CSS Module Scripts #206 — https://github.com/web-platform-tests/interop/issues/206
It would be great to see this issue have an assignee or any disposition indicating an intent to implement
Thank you for considering
Kiet Ho
Pull request: https://github.com/WebKit/WebKit/pull/72110
andseier
Amazing to see a PR up for this — thanks so much for prioritizing ❤️
Kiet Ho
Pull request: https://github.com/WebKit/WebKit/pull/74961
Kiet Ho
*** Bug 222750 has been marked as a duplicate of this bug. ***
Kiet Ho
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/63294
EWS
Committed 322887@main (b1913f6615d4): <https://commits.webkit.org/322887@main>
Reviewed commits have been landed. Closing PR #74961 and removing active labels.