Skip to content

[css-cascade-4] [css-values-4] @import should be able to use Import Maps #8297

@argyleink

Description

@argyleink

Javascript imports can now be managed easier with Import Maps, a very welcomed feature for the web community. I propose being able to add entries to this map and use them from CSS @import. Feature matching CSS and JS imports.

Use case / example

Given the following import map:

{
  "imports": {
    "$fresh/": "https://deno.land/x/fresh@1.1.2/",
    "$design-system": "https://unpkg.com/open-props"
  }
}

In JS (works today):

import OpenProps from '$design-system/open-props.module.js'

In CSS (proposed feature alignment):

@import "$design-system/open-props.min.css" layer(design.system);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions