a { text-decoration: none;
&:hover { border-width: 1px }
}
上面說的函數(shù)只是簡單的一種 還可以映射到j(luò)s函數(shù)
混合還可以使用模式匹配來實現(xiàn)多可同名函數(shù) 等等
引導(dǎo) 是通過 一個判斷語句來 決定調(diào)用那些函數(shù)
可以使用內(nèi)置函數(shù)
下面就是常見的檢測函式:
iscolor
isnumber
isstring
iskeyword
isurl
如果你想判斷一個值是純數(shù)字,還是某個單位量,可以使用下列函式:
ispixel
ispercentage
isem
在引導(dǎo)的 when 中可以使用 and 和 not
less 提供的 顏色函數(shù)
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