- From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
- Date: Thu, 19 Jul 2018 22:06:15 +0000
- To: public-css-archive@w3.org
I'm not sure I understand. That seems like ordinary nesting, which you can do with just:
```
.parent {
& .foo { color: red; }
& .foo2 { color: yellow; }
& .foo3 { color: blue; }
}
```
The only reason you'd need to use `@nest` is if you wanted to put the `.parent`-based styling inside of the foo/foo2/foo3 blocks, like:
```
.foo {
...
@nest .parent & { color: red; }
}
.foo2 {
...
@nest .parent & { color: yellow; }
}
.foo3 {
...
@nest .parent & { color: blue; }
}
```
If that's the style you want, to keep all of the `.foo` styles together and separate from the `.foo2` or `.foo3` styles, then yes, you'd have to write that `.parent &` selector a few times.
But your proposal doesn't seem to do anything about that, so I'm not sure I understand what you're trying to propose.
--
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2909#issuecomment-406429028 using your GitHub account
Received on Thursday, 19 July 2018 22:06:18 UTC