定义一个带参数和默认值的mixin class
// demo.scss 
@mixin button($background:#606266) {
    font-size: 1em;
    padding: 0.5em 1.0em;
    text-decoration: none;
    color: #fff;
    background: $background;
}
@include 引用带参数的mixin class
@import "./demo.scss";
.button-green {
  //@include button(#409ffe); // OK的
    @include button($background: green);  // OK的
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-21
  • 2022-12-23
  • 2021-06-11
  • 2021-11-03
  • 2022-12-23
  • 2021-08-13
猜你喜欢
  • 2022-12-23
  • 2021-11-08
  • 2021-11-28
  • 2022-12-23
  • 2021-12-04
  • 2022-12-23
相关资源
相似解决方案