csstools / postcss-extend-rule

Use the @extend at-rule and functional selectors in CSS
https://jonathantneal.github.io/postcss-extend-rule/
Creative Commons Zero v1.0 Universal
51 stars 7 forks source link

Expected output when extending a class that appears in more complex rules #5

Closed adamwathan closed 5 years ago

adamwathan commented 5 years ago

Hey Jonathan! I couldn't find this documented in the spec or the plugin but what is the expected behavior when you do something like this?

.foo .bar {
  color: red;
}

.baz {
  @extends .bar;
}

Right now you get this output:

.foo .bar {
  color: red;
}

.baz {
}

...where I was sort of expecting this:

.foo .bar {
  color: red;
}

.foo .baz {
  color: red;
}

Is this by design?

wesleyboar-fka-iosulfur commented 5 years ago

Try @extend instead of @extends.

adamwathan commented 5 years ago

Oh my god 🤦‍♂ Thank you!