libsass icon indicating copy to clipboard operation
libsass copied to clipboard

@extend does not output inheriting class when also using @content

Open hellatan opened this issue 12 years ago • 1 comments

When @extending one class that is using a mixin which applies the @content feature, the inheriting class does not get added into the @content area. The following is a copy of this gist on sassmeister showing the resulting output.

@mixin media-query() {
    @media only screen {
        @content;
    }
}

.class-1 {
    display: block;
    @include media-query() {
        display: none;
    }
}

.class-2 {
    @extend .class-1;
}

results in this:

.class-1, .class-2 {
  display: block; }
  @media only screen {
    .class-1 {
      display: none; } }

When using both sass 3.2.19 and 3.3.5 in sassmeister, the result is this:

.class-1, .class-2 {
    display: block;
}
@media only screen {
    .class-1, .class-2 {
        display: none;
    }
}

hellatan avatar Apr 19 '14 20:04 hellatan

I believe this is a duplicate of #185

HamptonMakes avatar Oct 04 '14 18:10 HamptonMakes