Re: [csswg-drafts] [css-nesting] Problem with mixing properties and selectors (#8249)

I wasn't in the call (got stuck in traffic) but I personally still think we are on the right track, and I'm not concerned about most of these issues.

However, I would _also_ be fine with a syntax that mandates that declarations have to precede rules, as I think that's good authoring practice in general (and would make the backtracking needed even more efficient, as it only needs to be done max once per rule). We decided against an author-facing parser switch (i.e. syntax authors would have to use to invoke the other mode). An automatic parser switch managed by the browser as it encounters syntax would be fine by me, and seems very easy to teach. It is also very compatible with allowing them to be intermixed in the future. Reading the minutes, @jensimmons brought up a concern that this would restrict use cases, but did not elaborate further (or wasn't minuted doing so):

> <fantasai> jensimmons: I dont' like the idea of requiring that declarations go before nested rules
> <fantasai> ... like plinss says, people jam CSS into things all over the place
> <fantasai> ... it will make things less useful

I was wondering what cases you had in mind?

Also, could someone explain this further? 

> Unintuitive cascading behavior when declarations come after rules

Is this that in cases like these:

```css
.foo {
 color: red;

 & {
  color: green;
 }

 color: blue;
}
```

You'd expect the color to be blue, but it's actually green?

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


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

Received on Wednesday, 12 April 2023 21:26:06 UTC