Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sass @content feature support? #8

Closed
MadLittleMods opened this issue Apr 23, 2015 · 2 comments
Closed

Sass @content feature support? #8

MadLittleMods opened this issue Apr 23, 2015 · 2 comments

Comments

@MadLittleMods
Copy link
Contributor

In Sass you are able to pass in arbitrary content into a mixin with the @content directive.

Is there a way to accomplish this now? Plans to support it?

$should-show: true;

@mixin some-mixin {
    @if $should-show {
        @content;
    }
}

.item {
    width: 100px;
    height: 100px;

    background: rgba(255, 0, 0, 1);

    @include some-mixin {
        background: rgba(0, 255, 0, 1);
    }
}

What about passing arguments from a mixin to a content block?

via jackmahoney's comment

@mixin foo($a, $b){
    @content($c, $d)
}

@include foo($a, $b) using($c, $d) {
    // ...
}
@ai ai added the enhancement label Apr 23, 2015
@ai
Copy link
Member

ai commented Apr 23, 2015

Yeap, I will add it when i finish PostCSS Plugins Guidelines.

@ai
Copy link
Member

ai commented May 9, 2015

Done c6773d5

@ai ai closed this as completed May 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants