LessCSS - IE gradient filter with variables and lighten

后端 未结 2 1174
没有蜡笔的小新
没有蜡笔的小新 2021-01-18 23:39

I need to have an IE gradient filter in Less CSS with a variable and lighten. Is this possible?

#whatever {
    filter:progid:DXImageTransform.Microsoft.gra         


        
2条回答
  •  后悔当初
    2021-01-19 00:24

    As far as I know you can't mix escaping (because that's what you need here) and colour functions (lighen). So you'll need to store the startColor value in another variable.

    @grayColor :#ffffdffffd;
    @greenColor : #ff0000;
    @start : lighten(@grayColor, 3%);
    .css {
       filter:~"progid:DXImageTransform.Microsoft.gradient(startColorstr='@{start}', endColorstr='@{greenColor}', GradientType=0)";
    }
    

提交回复
热议问题