Re: [csswg-drafts] [css-nesting] Syntax suggestion (#4748)

@mirisuzanne Ahh, I think I understand you, and if so, that's a pretty major difference. Lemme get this straight... you envisioned that brackets would only really be a benefit in this situation?
```scss
.foo {
  @nest .bar & { color: red; }
  @nest .baz & { color: green; }
  @nest .blah & { color: yellow; }
}
```

i.e. it could be:
```scss
.foo {
  {
    .bar & { color: red; }
    .baz & { color: green; }
    .blah & { color: yellow; }
  }
}
```
?


On my end, I was thinking that the brackets would be highly useful in situations where instead of repetitive ampersands before each nested selector:

```scss
.foo {
  & .bar { color: red; }
  & .baz { color: green; }
  & .blah { color: yellow; }
  /* etc */
}
```
...you'd just have a clean look like this:
```scss
.foo {
  {
    .bar { color: red; }
    .baz { color: green; }
    .blah { color: yellow; }
    /* etc */
  }
}
```

I'm trying to think practically here. Lots of devs, myself included, would be coming from SCSS. The syntax I was intending was to help minimize work needed to convert existing SCSS; just select nested selectors and wrap with brackets—done. After all, I'd guess that something like 90%+ of the time, we only use simple nesting (`.foo { .bar { ... } }`) instead of the more complex `.foo { html.fooActive & { ... } }` type stuff...

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


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

Received on Thursday, 28 July 2022 19:30:28 UTC