1 2 3 4 5 6 7 8 | .mixin (@a) when (@a >= 10) { background-color: black; } .mixin (@a) when (@a < 10) { background-color: white; } .class1 { .mixin(12) } .class2 { .mixin(6) } |
1 2 3 4 5 6 | .class1 { background-color: black; } .class2 { background-color: white; } |
1 2 3 4 5 6 7 8 | .mixin (@a) when (iscolor(@a)) { background-color: black; } .mixin (@a) when (isnumber(@a)) { background-color: white; } .class1 { .mixin(red) } .class2 { .mixin(6) } |
1 2 3 4 5 6 | .class1 { background-color: black; } .class2 { background-color: white; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | .smaller (@a, @b) when (@a > @b) { background-color: black; } .math (@a) when (@a > 10) and (@a < 20) { background-color: red; } .math (@a) when (@a < 10),(@a > 20) { background-color: blue; } .math (@a) when not (@a = 10) { background-color: yellow; } .math (@a) when (@a = 10) { background-color: green; } .testSmall {.smaller(30, 10) } .testMath1 {.math(15)} .testMath2 {.math(7)} .testMath3 {.math(10)} |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | .testSmall { background-color: black; } .testMath1 { background-color: red; background-color: yellow; } .testMath2 { background-color: blue; background-color: yellow; } .testMath3 { background-color: green; } |
1 2 3 4 5 6 7 8 9 10 | @var: red; #page { @var: white; #header { color: @var; } } #footer { color: @var; } |
1 2 3 4 5 6 | #page #header { color: #ffffff; // white } #footer { color: #ff0000; // red } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | @var-color: white; #bundle { @var-color: black; .button () { display: block; border: 1px solid black; background-color: @var-color; } .tab() { color: red } .citation() { color: black} .oops {weight: 10px} } #header { color: @var-color; #bundle > .button; #bundle > .oops; |
1 2 3 4 5 6 7 8 9 10 | #bundle .oops { weight: 10px; } #header { color: #ffffff; display: block; border: 1px solid black; background-color: #000000; weight: 10px; } |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |