Skip to content

Commit

Permalink
[WIP] Add style sheet module scripts
Browse files Browse the repository at this point in the history
This patch provides CSS modules as a single default export, of
a CSSStyleSheet object, which is not added to the document.

Edge cases which I didn't see discussed elsewhere:
- @imports are recursively fetched together with the module graph,
  blocking script execution. Network errors reached prevent the
  execution of the entire module graph.
- Any MIME type whose essence is "text/css" is accepted; this appears
  to be weaker checking than elsewhere in the specification.
- Although the Constructable Stylesheet Objects proposal is used for
  infrastructure, the resulting CSSStyleSheet object acts as if it
  were not constructed (i.e., you can't call the replace() method).

Note, the Constructable Stylesheet Objects proposal makes important steps
to specifying loading of @import, but there may still be room for more
precise plumbing with HTML. This text ensures that style sheet module scripts
have a base URL and fetch options, which might be referenced by the definition
of @import in the future.

This patch is based on
tc39/proposal-built-in-modules#44

Closes whatwg#4315
Closes WICG/webcomponents#759
  • Loading branch information
littledan committed Mar 8, 2019
1 parent f9e4c66 commit c9fa754
Showing 1 changed file with 233 additions and 87 deletions.
Loading

0 comments on commit c9fa754

Please sign in to comment.