less

//.mixin (@a) when (lightness(@a) >= 50%) {   //255/2=127.5
// background-color: black;
//}
//.mixin (@a) when (lightness(@a) < 50%) {
// background-color: white;
//}
//.mixin (@a) {
// color: @a;
//}
//.class1 { .mixin(#7e7e7e) } //221 > 127.5 >50% background-color: black; 7e7e7e = 126
//.class2 { .mixin(#808080) } //85 <127.5 <50% background-color: white; 808080 = 128 //iscolor,isnumber.....判断值得类型
//.mixin (@a) when (iscolor(@a)) { //255/2=127.5
// background-color: black;
//}
//.mixin (@a) when (isnumber(@a) ) {
// background-color: white;
// shuzi:shuzi;
//}
//.mixin (@a) {
// color: @a;
//}
//.class1 { .mixin(#7e7e7e) } //background-color: black;
//.class2 { .mixin(123) } //background-color: white; //ispixel,ispercentage.....单位检查函数
.mixin (@a) when (ispixel(@a)) {
background-color: black;
}
.mixin (@a) when (ispercentage(@a) ) {
background-color: white;
}
.mixin (@a) {
width: @a;
}
.class1 { .mixin(960px) } //background-color: black; width:960px
.class2 { .mixin(95%) } //background-color: white;width:95%

css

.class1 {
background-color: black;
width: 960px;
}
.class2 {
background-color: white;
width: 95%;
}

最新文章

  1. 深入理解javascript函数参数与闭包(一)
  2. gcc 4.8.3 install centos
  3. Vijos 1092 全排列
  4. Spring中Template模式与callback的结合使用浅析
  5. 在jsp页面解析json的2种方法
  6. j2ee的十三个规范
  7. jQuery 2.2 和 1.12 新版本发布
  8. BestCoder 1st Anniversary ——HDU5312(数学推导)
  9. 如何配置Tomcat以使用Apache httpd?
  10. mysql查询正在执行的sql
  11. Float与二进制之间的转化(Java实现)
  12. DButils实现增删查改
  13. Flannel - 原理
  14. image 标签src
  15. [leetcode]252. Meeting Rooms会议室有冲突吗
  16. 想到的regular方法果然已经被sklearn实现了就是L1和L2组合rugular
  17. 09.Curator临时节点
  18. 开源一个Java Class实现Openfire登陆、推出、消息发送,方便其他系统集成IM功能了
  19. LayIM.AspNetCore Middleware 开发日记(二)预备知识介绍
  20. 白盒测试实践项目(day2)

热门文章

  1. Mysql学习总结(31)——MySql使用建议,尽量避免这些问题
  2. mybatis 按照条件查询
  3. DQL查询语句使用(select)
  4. HDU 4333 Contest 4
  5. MyEclipse2014高速配置Spring &amp;amp; Spring Testing, Spring AOP简单使用
  6. 打印全排列和stl::next_permutation
  7. bzoj1570: [JSOI2008]Blue Mary的旅行(二分+网络流)
  8. [雅礼NOIP2018集训 day1]
  9. [Swift]数组(Array)最强解析
  10. navigator.clipboard 浏览器原生剪贴板