Re: [csswg-drafts] [css-nesting] request to pick up the css-nesting proposal

One issue is missed in this thread – error handling. [According to spec](https://drafts.csswg.org/css-syntax/#error-handling) declarations and qualified rules (nested rules as well) have different rules for bad content elimination.
For example, the CSS:
```css
.example {
  background: white;
  &:hover {
     background: gray;
     color: green;
  }
  color: red;
}
```
Will turn to
```css
.example {
  background: white;
}
```
for any modern browser. So `color: red` will be vanished as bad content.
However, with nesting rule support things may be changed – `color: red` will be applied, even with an error in selector (that produce a bad qualified rule that will be thrown away).
Hopefully, nobody is used `&` in CSS. So introducing `&` as a starting for a nested qualified rule is quite safe.

> Alternatively, the only ambiguous case is when the selector starts with an element selector, right? If it starts with an id, class, pseudo-class, or pseudo-element, we know immediately.
What if the ampersand was only required in that case?


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

Received on Friday, 29 June 2018 21:29:22 UTC