postcss / postcss-mixins

PostCSS plugin for mixins
MIT License
466 stars 47 forks source link

How to nest mixins? #38

Closed Dylan-Chapman closed 8 years ago

Dylan-Chapman commented 8 years ago

Supposed I have a "between" mixin that takes two breakpoints defined from a map, and creates a media query from them. I know things like media-minmax and custom-media exist, but they don't do precisely what I need.

So, I have code that looks like this:

.test {
    @mixin between md, lg {
        @mixin row;
    }
}

This is output as:

@media only screen and (min-width:768px) and (max-width:991px) {
    .test {
        @mixin row
    }
}

Is there a way to have the @mixin-content that my "between" mixin spits out (@mixin row, in this scenario) actually be evaluated?

ai commented 8 years ago

I try to fix it. But maybe only on this weekend.

levibuzolic commented 8 years ago

Just encountered this same issue, my use case is also for a mixin nested inside a mixin that outputs a media query. :+1:

Dylan-Chapman commented 8 years ago

Any word on this?

ai commented 8 years ago

Sorry, I am total in preparation to dotCSS. But after Friday I will be free.

ai commented 8 years ago

Done 7861cbaa65f42cd4b5b30735ec9146be274ef487

ai commented 8 years ago

Released in 3.0

Dylan-Chapman commented 8 years ago

Works great, thanks!