vendor/leafo/lessphp/tests/inputs/guards.less (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
.simple(@hi) when (@hi) {
simple: yellow;
}
.something(@hi) when (@hi = cool) {
something: red;
}
.another(@x) when (@x > 10) {
another: green;
}
.flipped(@x) when (@x =< 10) {
flipped: teal;
}
.yeah(@arg) when (isnumber(@arg)) {
yeah-number: purple @arg;
}
.yeah(@arg) when (ispixel(@arg)) {
yeah-pixel: silver;
}
.hello(@arg) when not (@arg) {
hello: orange;
}
dd {
.simple(true);
}
b {
.something(cool);
.something(birthday);
}
img {
.another(12);
.flipped(2);
}
body {
.yeah(232px);
.yeah(232);
}
.something(@x) when (@x) and (@y), not (@x = what) {
something-complex: blue @x;
}
div {
@y: true;
.something(true);
}
.coloras(@g) when (iscolor(@g)) {
color: true @g;
}
link {
.coloras(red);
.coloras(#fff);
.coloras(#fffddd);
.coloras(rgb(0,0,0));
.coloras(rgba(0,0,0, .34));
}
|