慕雪6442864
//拼接括号就可以了@mixin gradient($start,$stop,$attr:background,$dir:top,$way:linear){ #{$attr}:#{$start}; @each $core in $coreList{ #{$attr}:-#{$core}-#{$way}-gradient +'('+(#{$dir},#{$start},#{$stop})+')'; }}//效果如下.gradient { background: #f2f2f2; background: -webkit-linear-gradient(top,#f2f2f2,#f8f8f8); background: -moz-linear-gradient(top,#f2f2f2,#f8f8f8); background: -o-linear-gradient(top,#f2f2f2,#f8f8f8); background: -ms-linear-gradient(top,#f2f2f2,#f8f8f8); }