Re: [csswg-drafts] [css-nesting-1] CSSOM for nested media query rules (#7850)

> I’m fine with implicitly wrapping with & {} if it makes it easier to implement, but it should be removed in serialization / CSSOM per our current principle about serialization being the shortest equivalent syntax (if original syntax cannot be preserved).

I'm fine with such a rule. Say something like “if the first sub-rule is & {…}, remove that in serialization”.

> Though we should explore if that would cause issues when using @media in @scope. Does wrapping in & {} there (which is equivalent to wrapping in :scope {}) change the meaning? These should be consistent.

You mean something like this, or am I misunderstanding you?

```css
@scope (from: .foo) and (to: .bar) {
  div {
    @media {
      color: red;  // Would be wrapped in & {}
    }
  }
}
```

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


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

Received on Friday, 21 October 2022 16:47:57 UTC