@include icon("icon-library", "\e621", $pon-icon);
@include icon("icon-calculate", "\e63a", $pon-icon);
@include icon("icon-clock", "\e648", $pon-icon);
@include icon("icon-bars", "\e698", $pon-icon);
@include icon("icon-cog2", "\e690", $pon-icon);
上面是设定值,下面是想要变成的CSS
.pon-icon-library:before {
font-family: $pon-icon;
content: "\e621";
}
目前有想到的方式为
@mixin pon-icon($icon){
font-family: $pon-icon;
content: $icon;
}
.pon-icon-library:before { @include pon-icon("\e621"); }
请问如何用类似循环或其它较精简的方式改写?
如果可用for-each直接把@include icon的值抓出来就好了。
谢谢