sass可以传一个URL地址到mixin中吗?

下面这种方式不行,用了#{$file}这种方式也不行。
clipboard.png

@mixin IE-filter-scale($file){
  filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=#{$file},  sizingMethod='scale');
}
.theme-logo{
   background:transparent url(../imgs/hpd_003.png) center center no-repeat;
   width:132px;
   height:40px;
   background-size:100%;
   @include IE-filter-scale(../imgs/hpd_003.png);
   margin-left: 59px;
}
[15:28:49] error happybao/stc/base/_foot.scss (Line 69: Invalid CSS after "...E-filter-scale(": expected ")", was "../imgs/hpd_003...")
阅读 3.7k
2 个回答

这样试过么?

@mixin IE-filter-scale($file){
  filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='#{$file}',  sizingMethod='scale');
}

@mixin IE-filter-scale($file){
$url:"'../imgs/#{$file}.png'";
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=#{$url}, sizingMethod='scale');
}

宣传栏