less
2019-06-13 本文已影响0人
叫我王必过
一、变量
@width: 10px;
@height: @width + 10px;
#header {
width: @width;
height: @height;
}
二、混合
.bordered {
border-top: dotted 1px black;
border-bottom: solid 2px black;
}
#menu a {
color: #111;
.bordered();
}
.post a {
color: red;
.bordered();
}
三、运算
@color: #224488 / 2; //results in #112244
background-color: #112244 + #111; // result is #223355
@var: 50vh/2;
width: calc(50% + (@var - 20px));
四、内置函数
- color:解析颜色,将代表颜色的字符串转换为颜色值
- convert : 将数字从一种单位转换到另一种单位。
- data-uri: 将资源内联进样式表
- unit:删除或更换单位
- escape:对字符串中的特殊字符做 [URL-encoding]编码
- 等等~~~~
想了解更多请看:https://www.jianshu.com/p/df9411f6d8ab