@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的值抓出來就好了。
謝謝