[英]less linear gradient filter
我在混入较少的问题。
我少了文件。
.gradient(@startColor, @endColor) {
background: @startColor;
background: linear-gradient(to bottom, @startColor 0%,@endColor 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='@{startColor}', endColorstr='@{endColor}',GradientType=1 );
}
#nav {
.gradient(#fff,#e2ebef);
}
.btn {
.gradient(#f2f2f2, #e4e4e4);
}
编译后我得到这个:
#nav {
background: #ffffff;
background: linear-gradient(to bottom, #ffffff 0%, #e2ebef 100%);
filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ffffff', endColorstr='#e2ebef', GradientType=1);
}
.btn {
background: #f2f2f2;
background: linear-gradient(to bottom, #f2f2f2 0%, #e4e4e4 100%);
filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ffffff', endColorstr='#e2ebef', GradientType=1);
}
为什么.btn过滤器中的颜色与#nav中的颜色相同? 我已经用谷歌搜索了解决方法,但是没有找到任何可以解决这个问题的方法。
所以...除了在生成的CSS文件中手动粘贴颜色以外,还有其他解决方案吗?
将filter属性更改为:
filter: ~"progid:DXImageTransform.Microsoft.gradient(startColorstr='@{startColor}', endColorstr='@{endColor}', GradientType=1)";
这会自动转义filter属性中的许多废话,并允许正确输出该字符串中的变量。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.