Skip to content

CSS Module Scripts #597

@dandclark

Description

@dandclark

Description

CSS modules (with import attributes) are a way to import CSS files in JavaScript via the ES module syntax.

Note: Per discussion of the interop team this proposal is split off from #436 to be considered independently of JSON module scripts in proposal selection.
cc @o-t-w.

Specification

https://github.com/tc39/proposal-import-attributes
whatwg/html#4898

Open Issues

whatwg/html#7233
There is an open PR that would close this issue.

Tests

https://wpt.fyi/results/html/semantics/scripting-1/the-script-element?label=master&label=experimental&aligned&q=%28import-attributes%20or%20css%29%20and%20not%20assertions

Current Implementations

  • Blink
  • Gecko
  • WebKit

Standards Positions

Safari Technology Preview supports import attributes.
WebKit position on CSS module scripts

Chrome Canary is currently updating the import attribute syntax from import assertions.

Gecko standards position on CSS modules

Browser bug reports

Gecko bug for import attributes.
Gecko bug for CSS modules scripts

Developer discussions

Polls & Surveys

No response

Existing Usage

No response

Workarounds

No response

Accessibility Impact

No impact.

Privacy Impact

No impact.

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions