This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 26546 - importing style sheets and HTML imports from ES6 modules
Summary: importing style sheets and HTML imports from ES6 modules
Status: RESOLVED INVALID
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: 2015 Q1
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on: 25715
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-08 18:37 UTC by Ian 'Hixie' Hickson
Modified: 2016-02-14 16:11 UTC (History)
7 users (show)

See Also:


Attachments

Description Ian 'Hixie' Hickson 2014-08-08 18:37:23 UTC
It would be cool to support something like:

   import mystyles from "foo.css";

...which would result in a <link> being added to the Document (if one isn't there already) pointing to foo.css. "mystyles" would expose that to the script somehow.

Obviously normally this would be just getting a reference to an already-downloaded style sheet, since we don't want to be doing these late-bound (same with how we're probably going to want to predeclare the modules that are imported, so that they're not fetched late-bound either, in pre-HTTP2 environments).
Comment 1 Tab Atkins Jr. 2014-08-09 15:09:32 UTC
Manipulating the document as a side-effect probably isn't what we want; instead, let's just make stylesheets constructable and have the loader hook do *that* instead.
Comment 2 Ian 'Hixie' Hickson 2014-08-18 20:36:27 UTC
Yeah. Importing an image wouldn't want to do anything to the DOM either.
Comment 3 Anne 2016-02-14 16:11:45 UTC
Ideas have evolved a bit since 2014 and there's no real need to track this here.