postcss-mixins

1.安装
# yarn add postcss-mixins -D
2.配置(postcss.config.js)
module.exports = {
  plugins: [
    ...,
    require('postcss-mixins'),
    ...
  ]
}
3.使用

例1

@define-mixin a $b1, $c1: blue {
  .a1-$(b1) {
    color: $c1;
  }

  .a2-$(b1) {
    color: $c1;
  }
}

@mixin a b-1 {}

@mixin a b-2, red {}

results matching ""

    No results matching ""