postcss / postcss-mixins

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

use with postcss-custom-properties #82

Closed Memoyr closed 6 years ago

Memoyr commented 6 years ago

Hi , Is it normal that this isn't working while using with postcss-custom-properties ? It strips out everything from the rule value but not the actual argument.

@define-mixin generate $size {
    font-size: var(--text$(size);
}
.test {
  @mixin generate sm;
}

output :

.test {
   font-size: sm;
}

thanks

ai commented 6 years ago

Input should be:

@define-mixin generate $size {
  font-size: var(--text$(size));
}
.test {
  @mixin generate sm;
}

What is you PostCSS config?

Memoyr commented 6 years ago

yes - typo here for the missing parenthesis, that's not the cause of the issue.

module.exports = {
  "plugins": {
    'postcss-apply':{
      preserve: true
     },
    'postcss-import': {},
    'postcss-url': {},
    'postcss-cssnext': {
         browsers: ['last 2 versions', '> 5%'],
    },
    'postcss-custom-media':{},
    'postcss-mixins':{},
    'postcss-nesting':{},
    'postcss-conditionals':{},
    }
}
ai commented 6 years ago

Move postcss-cssnext after postcss-mixins

Memoyr commented 6 years ago

thanks @ai