postcss / postcss-mixins

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

copnverting @include to css #143

Closed Markj89 closed 2 years ago

Markj89 commented 2 years ago

I'm using SCSS with Postcss and Tailwind to convert it to css. I added the mixins dependency to automate my root colors but I noticed the package doesn't support @include

Here's my code:

@define-mixin themeColor, $name, $color {
    .($name) {
        color: $color;
    }
}

@include theme-color(--blue, --blue);
@include theme-color(--red, --red);
@include theme-color(--yellow, --yellow);
@include theme-color(--salmon, --salmon);
@include theme-color(semi_black, --semi-black);
@include theme-color(--main-color, --main-color);

Once I compile it, it will only render the @include.


@include theme-color(--blue, --blue);
@include theme-color(--red, --red);
@include theme-color(--yellow, --yellow);
@include theme-color(--salmon, --salmon);
@include theme-color(semi_black, --semi-black);
@include theme-color(--main-color, --main-color);
ai commented 2 years ago

You need to replace @include to @mixin.

If you want old syntax, there is alternative plugin in docs.