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)); 

四、内置函数

上一篇 下一篇

猜你喜欢

热点阅读