[问题] 如何改成精简的写法

楼主: ponba (胖爸)   2014-07-08 11:04:07
@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的值抓出来就好了。
谢谢
作者: mars90226 (火星人)   2014-07-08 14:13:00
你po错版了?虽然说应该是SASS,不过Web_Design版应该更好就是了
楼主: ponba (胖爸)   2014-07-08 22:21:00
谢谢

Links booklink

Contact Us: admin [ a t ] ucptt.com