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

查看:223
本文介绍了scss - sass可以传一个URL地址到mixin中吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

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

@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...")

解决方案

这样试过么?

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

这篇关于scss - sass可以传一个URL地址到mixin中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆