Repository navigation
Module Stylesheet <link> tags - #12860
KurtCattiSchmidt wants to merge 2 commits into
Conversation
|
See #10673 (comment) |
@LeaVerou - this was discussed a few weeks ago at WHATNOT and added to the design doc. More details in this comment in the old PR. Please add more pros and cons to the design doc if you think of any that are missing. This PR is no longer using
One of the main goals of this proposal is parity with importing a CSS module via script. Any changes to the module graph would require changes to how
The existing existing TAG response also supported using |
|
This was agendad for the 2026-09-17 meeting but we ran out of time so
agenda+
|
|
It would be good to update OP if type="module" isn't being used anymore (it confused me initially) |
|
The latest proposal is: <link type=text/css rel=stylesheet import=foo.css> |
To clarify, the
|
I see this (PR 12860 Module Stylesheets Syntax) was indeed discussed at the WHATNOT meeting on 2026-09-24, see meeting notes. I note that style module imports (i.e. the new |
|
The way JS solved this was |
|
@LeaVerou - you're right, vs But we also have |
I think either is fine. Let's pick one and do this.
I wouldn't worry too much about consistency with |
|
I agree with @noamr about So it's about following one of two existing precedents vs creating a third 😅 FWIW I do think That said, neither |
Also |
|
I don't know if
|
@LeaVerou - yeah, the extensibility aspect on other elements is pretty great for |
|
|
cc/ @whatwg/modules |
|
Is FOUC addressed by this? If not, it seems very unlikely to be used in declarative Shadow DOM. It's likely also not acceptable unless explicitly specified. I believe currently, blocking rendering only happens if the link is potentially render-blocking, and a document stops accepting render-blocking elements once |
|
One thing I came up with just after the TPAC session: The |
But modules can fetch with use-credentials no? |
Adds support for
<link rel=stylesheet import=foo>, where theimportattribute performs a module stylesheet import, equivalent toimport("foo", { with: { type: "css" } }in Javascript.At least two implementers are interested (and none opposed):
Tests are written and can be reviewed and commented upon at:
Implementation bugs are filed:
Corresponding HTML AAM & ARIA in HTML issues & PRs: N/A
MDN issue is filed: Module Stylesheet <link> tags mdn/mdn#824
The top of this comment includes a clear commit message to use.
(See WHATWG Working Mode: Changes for more details.)
Addresses #10673
/indices.html ( diff )
/links.html ( diff )
/semantics.html ( diff )
/webappapis.html ( diff )