Kronuz / pyScss

pyScss, a Scss compiler for Python
MIT License
582 stars 141 forks source link

@content directive not working when called after @include statement #239

Open antonpirker opened 11 years ago

antonpirker commented 11 years ago

The @content directive does not work when there is a @include statement called before.

See this sample test.scss file for illustration of the problem:

@mixin disable-prefix-for-all() {
    .test {
        color: blue;
    }
}

@mixin keyframes($name) {
    @include disable-prefix-for-all();
    @-webkit-keyframes #{$name} {
        @content;
    }
}

@include keyframes(mc-hide) {
    0% {
        margin-right: 0px;
    }
    100% {
        margin-right: -220px;
    }
}

Somehow the line @include disable-prefix-for-all(); prevents the @content to be rendered.

This is what i would expect (what sass is generating)

$ sass test.scss 
.test {
  color: blue; }

@-webkit-keyframes mc-hide {
  0% {
    margin-right: 0px; }

  100% {
    margin-right: -220px; } }

And this is what pyScss renders: (the @content part is just gone)

$ pyscss --no-compress test.scss 
.test {
  color: blue;
}
@-webkit-keyframes mc-hide {
}

When I remove the @include disable-prefix-for-all(); line, everything is rendered as expected.

mshevtsov commented 10 years ago

I have the same problem trying to use _keyframes.scss in Bourbon library.