less避免编译

less里面有一个避免编译,有时候我们需要输出一些不正确的css语法或者使用less不认识的专有语法。要输出这样的值我们可以在字符串前加上一个~

/*避免编译*/

.test_03{
  width: 300px;
  height: calc(300px - 30px);
}
=>
.test_03 {
  width: 300px;
  height: calc(270px);
}
这个calc,有时候我们是让浏览器计算, 不是让less计算
.test_03{
  width: 300px;
  height: ~'calc(300px - 30px)';
}
=>
.test_03 {
  width: 300px;
  height: calc(300px - 30px);
}

猜你喜欢

转载自www.cnblogs.com/wzndkj/p/9315842.html
今日推荐