W3C home > Mailing lists > Public > public-css-archive@w3.org > October 2020

[csswg-drafts] [css-cascade] Cascade layers need an import syntax (#5681)

From: Miriam Suzanne via GitHub <sysbot+gh@w3.org>
Date: Wed, 28 Oct 2020 23:11:40 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-731852093-1603926699-sysbot+gh@w3.org>
mirisuzanne has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-cascade] Cascade layers need an import syntax ==
The [current cascade-layers proposal](https://gist.github.com/mirisuzanne/4224caca74a0d4be33a2b565df34b9e7#import-syntax) offers several directions. 

This also raises some question around ordering of `@layer` and `@import` rules. Currently:

- Layering is determined by source-order of `@layer` rules
- `@import` is required to come first in a document.

## Using `@layer`

The most direct approach would be allowing a `url()` in place of a `{…}` code block in the `@layer` rule:

```css
/* @layer <name>? url(<contents>) */
@layer reset url(reset.css);
@layer bootstrap url(bootstrap.css);
```

## Using `@import`

It may also be possible to build on the existing `@import` syntax:

```css
@import layer reset url(reset.css);
@import layer(reset) url(reset.css);
```

## Other options?

Other proposals include  creating a new at-rule, or allowing imports to be nested inside the block syntax:

```css
/* new rule */
@layer-import reset url(reset.css);

/* nested imports */
@layer reset { 
  @import url(reset.css); 
}

/* etc… */
```

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5681 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 28 October 2020 23:11:42 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:21 UTC