Re: [csswg-drafts] [css-cascade-5] Allow authors to explicitly place unlayered styles in the cascade layer order (#6323)

Yes, it would refer to styles that are not further layered. Given the following, and an element with `class='btn green'`, the default will be `maroon`:

```css
.btn { background: maroon; }

@layer framework {
  .btn { background: rebeccapurple; }

  @layer utility {
    .green { background: green; }
  } 
}
```

But if we want `framework.utility` to take precedence, we can do it by re-ordering initial layers. Either once up front:

```css
@layer initial, framework.initial, framework.utility;
```

Or defining the order for each level of nesting:

```css
@layer initial, framework;

.btn { background: maroon; }

@layer framework {
  @layer initial, utility;

  .btn { background: rebeccapurple; }

  @layer utility {
    .green { background: green; }
  } 
}
```



-- 
GitHub Notification of comment by mirisuzanne
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6323#issuecomment-946916890 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 19 October 2021 16:55:54 UTC