Skip to content

Conversation

@goto-bus-stop
Copy link
Member

This patch fixes some invalid selectors. CSS nesting doesn't actually
work like this:

.Parent {
  &-child {
    color: red;
  }
}

Instead, the & is a selector that matches real elements, so here
color: red only applies to .Parents that also match -child,
which doesn't make a whole lot of sense. It used to work because
the postcss nesting plugin happens to compile it to .Parent-child.

Ref: https://tabatkins.github.io/specs/css-nesting/#nest-selector

(Churn churn churn)

This patch fixes some invalid selectors. CSS nesting doesn't actually
work like this:

```css
.Parent {
  &-child {
    color: red;
  }
}
```

Instead, the `&` is a selector that matches real elements, so here
`color: red` only applies to `.Parent`s that also match `-child`,
which doesn't make a whole lot of sense. It used to work because
the postcss nesting plugin happens to compile it to `.Parent-child`.

Ref: https://tabatkins.github.io/specs/css-nesting/#nest-selector
@goto-bus-stop
Copy link
Member Author

This is gonna be fun to reconcile with #514 😅 😭

@goto-bus-stop goto-bus-stop merged commit 3dd1396 into u-wave:master May 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant