雪碧图生成问题
pfan123 opened this issue · comments
ning chen commented
sass雪碧图合并函数:
// 雪碧图合并
// $name:[雪碧图名称]
// $img:[图标文件名]
// $rem:[单位]rem/px
// $rootvalue:[如果是rem需要指定一个rootvale值]
// 使用:@include as('halo', 'icon_halo'); 或 @include as('halo', 'icon_halo', rem);
@mixin as($name:sprite,$img:'',$rem: 'px', $rootvalue: 20){
@if($rem!='rem'){
$rem: 'px';
}
@if($rem=='rem'){
$rem: 'rem=#{$rootvalue}';
}
@if(''!=$img){
background: url(images/#{$img}@2x.png?__sprite=#{$name}&__#{$rem});
}
}
我们通过这样调用
@include as("icon", "p1_btn", "rem");
@include as("icon", "p1_btn", "px");
生成出来的雪碧图,只会选择一种单位,而我需要两种单位
或
@include as("page", "p1_btn", "rem");
@include as("icon", "p1_btn", "px");
生成出来的雪碧图,只会选择其中一个,且只选择一种单位,而我需要是要两张雪碧图,两种单位
Li,Weitao commented
已添加支持