I have a .less stylesheet that has a mixin for custom gradients. When I create several gradients with it, the rules for all other browsers come out fine but the filter for old IE browsers doesn’t change after the first call.
Here is a stripped-down example I managed to replicate my problem with:
.myGradient(@bg: rbg(255,255,255), @start: #FFFFFF, @end: #E6E6E6) {
background: @start;
background: -webkit-linear-gradient(top, @start 0%,@end 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=@start, endColorstr=@end,GradientType=0 );
}
.one {
.myGradient(#ffa201,#ffa201,#ff7301);
}
.two {
.myGradient(#aaaaaa,#aaaaaa,#cccccc);
}
.three {
.myGradient(#ffffff,#ffffff,#000000);
}
Here is the resulting CSS as generated by lessc 1.3.0:
.one {
background: #ffa201;
background: -webkit-linear-gradient(top, #ffa201 0%, #ff7301 100%);
filter: progid:dximagetransform.microsoft.gradient(startColorstr=#ffa201, endColorstr=#ff7301, GradientType=0);
}
.two {
background: #aaaaaa;
background: -webkit-linear-gradient(top, #aaaaaa 0%, #cccccc 100%);
filter: progid:dximagetransform.microsoft.gradient(startColorstr=#ffa201, endColorstr=#ff7301, GradientType=0);
}
.three {
background: #ffffff;
background: -webkit-linear-gradient(top, #ffffff 0%, #000000 100%);
filter: progid:dximagetransform.microsoft.gradient(startColorstr=#ffa201, endColorstr=#ff7301, GradientType=0);
}
As you can see, the webkit gradient works as expected but the IE one always stays orange. What could be wrong?
Try with: