less09 判断语句
2024-09-05 21:49:29
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%;
}
最新文章
- 深入理解javascript函数参数与闭包(一)
- gcc 4.8.3 install centos
- Vijos 1092 全排列
- Spring中Template模式与callback的结合使用浅析
- 在jsp页面解析json的2种方法
- j2ee的十三个规范
- jQuery 2.2 和 1.12 新版本发布
- BestCoder 1st Anniversary ——HDU5312(数学推导)
- 如何配置Tomcat以使用Apache httpd?
- mysql查询正在执行的sql
- Float与二进制之间的转化(Java实现)
- DButils实现增删查改
- Flannel - 原理
- image 标签src
- [leetcode]252. Meeting Rooms会议室有冲突吗
- 想到的regular方法果然已经被sklearn实现了就是L1和L2组合rugular
- 09.Curator临时节点
- 开源一个Java Class实现Openfire登陆、推出、消息发送,方便其他系统集成IM功能了
- LayIM.AspNetCore Middleware 开发日记(二)预备知识介绍
- 白盒测试实践项目(day2)
热门文章
- Mysql学习总结(31)——MySql使用建议,尽量避免这些问题
- mybatis 按照条件查询
- DQL查询语句使用(select)
- HDU 4333 Contest 4
- MyEclipse2014高速配置Spring &;amp; Spring Testing, Spring AOP简单使用
- 打印全排列和stl::next_permutation
- bzoj1570: [JSOI2008]Blue Mary的旅行(二分+网络流)
- [雅礼NOIP2018集训 day1]
- [Swift]数组(Array)最强解析
- navigator.clipboard 浏览器原生剪贴板