[csswg-drafts] [css-cascade] [css-nesting] Figure out whether we're fine with "shifting up" bare declarations after rules (#8738)

emilio has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-cascade] [css-nesting] Figure out whether we're fine with "shifting up" bare declarations after rules ==
If you do:

```
div {
  color: green;
  @media (width > 0) {
    color: red;
    background: red;
  }
  background: green;
}
```

My understanding is that per spec the div color and background would be red.

That seems rather confusing. There are various alternatives here:

 * We're ok with this.
 * We forbid declarations after nested rules.
 * We deal with bare declarations by somehow sorting them together, so that would be effectively something like:

```
div {
  color: green;
  @media (width > 0) {
    color: red;
    background: red;
  }
  & {
    background: green
  }
}
```

Maybe something else?

cc @fantasai 

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


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

Received on Wednesday, 19 April 2023 15:11:54 UTC