a { text-decoration: none;
&:hover { border-width: 1px }
}
上面说的函数只是简单的一种 还可以映射到js函数
混合还可以使用模式匹配来实现多可同名函数 等等
引导 是通过 一个判断语句来 决定调用那些函数
可以使用内置函数
下面就是常见的检测函式:
iscolor
isnumber
isstring
iskeyword
isurl
如果你想判断一个值是纯数字,还是某个单位量,可以使用下列函式:
ispixel
ispercentage
isem
在引导的 when 中可以使用 and 和 not
less 提供的 颜色函数
lighten(@color, 10%); // return a color which is 10% *lighter* than @color
darken(@color, 10%); // return a color which is 10% *darker* than @color
saturate(@color, 10%); // return a color 10% *more* saturated than @color
desaturate(@color, 10%); // return a color 10% *less* saturated than @color
fadein(@color, 10%); // return a color 10% *less* transparent than @color
fadeout(@color, 10%); // return a color 10% *more* transparent than @color
fade(@color, 50%); // return @color with 50% transparency
spin(@color, 10); // return a color with a 10 degree larger in hue than @color
spin(@color, -10); // return a color with a 10 degree smaller hue than @color
mix(@color1, @color2); // return a mix of @color1 and @color2