//less @color: #4d926f; //使用 #header { color: @color; }
//less .rounded-corners (@radius: 5px) { border-radius: @radius; } //使用 #footer { .rounded-corners(10px); }
//less @the-border: 1px; @base-color: #111; @red: #842210; #header { color: @base-color * 3; border-left: @the-border; border-right: @the-border * 2; } #footer { color: @base-color + #003300; border-color: desaturate(@red, 10%); } @arguments包含了所有传递进来的参数 .box-shadow (@x: 0, @y: 0, @blur: 1px, @color: #000) { box-shadow: @arguments; }
//less .arrow(@direction,@color,@pixel:5px) when (@direction = up) { .arrowup(@color); .arrowset(@pixel); } .arrow(@direction,@color,@pixel:5px) when (@direction = down) { .arrowdown(@color); .arrowset(@pixel); } //使用 div.d1{ .arrow(right,red); }
如对本文有疑问, 点击进行留言回复!!
深入理解CSS background-blend-mode的作用机制
网友评论