From 7f86d3dfc35d8141a5cbc69751ce87da09559459 Mon Sep 17 00:00:00 2001 From: "Frank.Qiu" Date: Fri, 13 Apr 2018 20:21:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=90=E5=8F=98=E6=B7=BB=E5=8A=A0=E6=96=B9?= =?UTF-8?q?=E5=90=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/less/visual.less | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/less/visual.less b/src/less/visual.less index e93022841b..9f04cd288b 100644 --- a/src/less/visual.less +++ b/src/less/visual.less @@ -59,6 +59,18 @@ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='@{start}', endColorstr='@{end}', GradientType='0'); } +// toSide表示渐变的方向, 使用角度兼容性好一些 +.gradient(@toSide, @start, @end) when not (@toSide = none) { + background: @start; //不支持的用这个 + background: -webkit-gradient(linear, 0 0, 0 100%, from(@start) to(@end)); /*old webkit*/ + background: -webkit-linear-gradient(@toSide, @start, @end); /*new webkit*/ + background: -moz-linear-gradient(@toSide, @start, @end); /*gecko*/ + background: -ms-linear-gradient(@toSide, @start, @end); /*IE10 preview*/ + background: -o-linear-gradient(@toSide, @start, @end); /*opera 11.10+*/ + background: linear-gradient(@toSide, @start, @end); /*future CSS3 browsers*/ + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='@{start}', endColorstr='@{end}', GradientType='0'); +} + .border-radius(@radius: 5px) { -webkit-border-radius: @radius; -moz-border-radius: @radius;