Implement CSS module scripts
Categories
(Core :: DOM: CSS Object Model, enhancement)
Tracking
()
People
(Reporter: daniec, Assigned: dminor)
References
(Depends on 1 open bug, Blocks 4 open bugs)
Details
(Keywords: dev-doc-complete, Whiteboard: [platform-feature])
User Story
web-feature: css-modules
Attachments
(10 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4544.0 Safari/537.36 Edg/93.0.933.1
Steps to reproduce:
The CSS module scripts feature has been merged into the HTML spec:
https://html.spec.whatwg.org/multipage/webappapis.html#creating-a-css-module-script
https://github.com/whatwg/html/pull/4898
Mozilla standards position (worth prototyping): https://github.com/mozilla/standards-positions/issues/541
Comment 1•4 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: Core & HTML' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Updated•4 years ago
|
Updated•4 years ago
|
Comment 2•4 years ago
|
||
There is another issue here we need to resolve: https://github.com/whatwg/html/issues/7233.
Updated•2 years ago
|
Comment 3•2 years ago
|
||
There are some WPT tests here for reference: https://wpt.fyi/results/html/semantics/scripting-1/the-script-element/css-module
Comment 4•2 years ago
|
||
Now that the import attributes spec has re-advanced to stage 3, will work start on this?
| Comment hidden (metoo) |
| Comment hidden (advocacy) |
Comment 7•5 months ago
|
||
I noticed import with type JSON had been released. 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.
Comment 8•4 months ago
|
||
Any luck moving the ball forward on this one? Could really use it.
| Assignee | ||
Updated•3 months ago
|
Comment 9•2 months ago
|
||
How's this going? Having the ability to confidently import CSS across browsers will be huge for browser development.
| Assignee | ||
Comment 10•2 months ago
|
||
I've started working on this, the development work should finish this year. It's too soon to tell what Firefox version we'll target for release, we'd normally keep something like this on Nightly for a few versions before shipping it.
Updated•2 months ago
|
| Assignee | ||
Comment 12•1 month ago
|
||
| Assignee | ||
Comment 13•1 month ago
|
||
| Assignee | ||
Comment 14•1 month ago
|
||
This adds a method to create a css module to the modules interface.
Unlike JavaScript or JSON modules, we don't have an ability to parse
CSS inside SpiderMonkey, so this method accepts an already parsed
CSSStyleSheet value from the caller, and wraps it in a module.
| Assignee | ||
Comment 15•1 month ago
|
||
| Assignee | ||
Comment 16•1 month ago
|
||
CSS Modules are not supported in Workers and Worklets. This adds a
IsModuleTypeAllowed to ModuleLoaderBase so that the subclasses can
decide which modules are allowed.
| Assignee | ||
Comment 17•1 month ago
|
||
This breaks out the common code path between creating a CSSStyleSheet
instance directly and creating one from a CSS module into a separate
method so it can be used from both places.
| Assignee | ||
Comment 18•1 month ago
|
||
| Assignee | ||
Comment 19•1 month ago
|
||
| Assignee | ||
Comment 20•1 month ago
|
||
This is to work around Bug 1985880, where Firefox serializes shorthands
without making URIs absolute.
| Assignee | ||
Comment 21•1 month ago
|
||
Comment 22•1 month ago
|
||
Comment 24•1 month ago
|
||
Comment 25•1 month ago
|
||
Backed out for causing Hazard failures.
Backout link: https://hg-edge.mozilla.org/integration/autoland/rev/eccda4c4708db12e5d72dfcc9482e2cd12aa729d
| Assignee | ||
Updated•1 month ago
|
Comment 27•1 month ago
|
||
| Assignee | ||
Comment 31•1 month ago
|
||
Looks like the problem was a missing include: https://treeherder.mozilla.org/jobs?repo=try&revision=f9bcb9b943eb6d3ac0e295d0a9e8905f01423738.
Comment 32•1 month ago
|
||
Comment 33•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/138d730d914a
https://hg.mozilla.org/mozilla-central/rev/b38b4d946d5d
https://hg.mozilla.org/mozilla-central/rev/4a9b27f40488
https://hg.mozilla.org/mozilla-central/rev/2c2adfa50a41
https://hg.mozilla.org/mozilla-central/rev/696bd3e935ca
https://hg.mozilla.org/mozilla-central/rev/0bc3830fe30b
https://hg.mozilla.org/mozilla-central/rev/dcf87eee4c34
https://hg.mozilla.org/mozilla-central/rev/a418506339ed
https://hg.mozilla.org/mozilla-central/rev/2ffe161bfa6e
https://hg.mozilla.org/mozilla-central/rev/03006e9098c3
https://hg.mozilla.org/mozilla-central/rev/43215867b9c2
Comment 34•1 month ago
|
||
Dan, is that something we should mention in our 145 nightly release notes? Thanks
| Assignee | ||
Comment 35•1 month ago
|
||
Release Note Request (optional, but appreciated)
[Why is this notable]: Support in Nightly for CSS Module scripts, a feature which has been present in Chromium for a few years, with developer interest.
[Affects Firefox for Android]: Yes.
[Suggested wording]: Support has been added for CSS module scripts in Firefox Nightly, disabled by default using the preference "layout.css.module-scripts.enabled". CSS module scripts allow for CSS scripts to imported like ECMAScript modules using import attributes.
[Links (documentation, blog post, etc)]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import/with, although that doesn't mention css module scripts yet.
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Comment 36•1 month ago
|
||
Note added as Nightly-only with this wording:
Starting with Firefox 145, support has been added for CSS module scripts, disabled by default using the preference
layout.css.module-scripts.enabled. CSS module scripts allow for CSS scripts to be imported like ECMAScript modules using import attributes.
Thanks
Updated•14 days ago
|
Comment 37•5 days ago
|
||
FF145 MDN docs work for this can be tracked in https://github.com/mdn/content/issues/41503
Description
•