2 // Stacking, functions..
4 .light (@a) when (lightness(@a) > 50%) {
7 .light (@a) when (lightness(@a) < 50%) {
14 .light1 { .light(#ddd) }
15 .light2 { .light(#444) }
17 // Arguments against each other
19 .max (@a, @b) when (@a > @b) {
22 .max (@a, @b) when (@a < @b) {
29 // Globals inside guards
33 .glob (@a) when (@a = @g) {
36 .glob1 { .glob(auto) }
40 .ops (@a) when (@a >= 0) {
43 .ops (@a) when (@a =< 0) {
46 .ops (@a) when (@a <= 0) {
47 height: lt-or-eq-alias;
49 .ops (@a) when not(@a = 0) {
56 // Scope and default values
60 .default (@a: inherit) when (@a = inherit) {
63 .default1 { .default }
65 // true & false keywords
66 .test (@a) when (@a) {
69 .test (@a) when not (@a) {
73 .test1 { .test(true) }
74 .test2 { .test(false) }
77 .test5 { .test("true") }
79 // Boolean expressions
81 .bool () when (true) and (false) { content: true and false } // FALSE
82 .bool () when (true) and (true) { content: true and true } // TRUE
83 .bool () when (true) { content: true } // TRUE
84 .bool () when (false) and (false) { content: true } // FALSE
85 .bool () when (false), (true) { content: false, true } // TRUE
86 .bool () when (false) and (true) and (true), (true) { content: false and true and true, true } // TRUE
87 .bool () when (true) and (true) and (false), (false) { content: true and true and false, false } // FALSE
88 .bool () when (false), (true) and (true) { content: false, true and true } // TRUE
89 .bool () when (false), (false), (true) { content: false, false, true } // TRUE
90 .bool () when (false), (false) and (true), (false) { content: false, false and true, false } // FALSE
91 .bool () when (false), (true) and (true) and (true), (false) { content: false, true and true and true, false } // TRUE
92 .bool () when not (false) { content: not false }
93 .bool () when not (true) and not (false) { content: not true and not false }
94 .bool () when not (true) and not (true) { content: not true and not true }
95 .bool () when not (false) and (false), not (false) { content: not false and false, not false }
99 .equality-unit-test(@num) when (@num = 1%) {
102 .equality-unit-test(@num) when (@num = 2) {
106 .equality-unit-test(1px);
107 .equality-unit-test(2px);
110 .colorguard(@col) when (@col = red) { content: is @col; }
111 .colorguard(@col) when not (blue = @col) { content: is not blue its @col; }
119 .stringguard(@str) when (@str = "theme1") { content: is theme1; }
120 .stringguard(@str) when not ("theme2" = @str) { content: is not theme2; }
121 .stringguard(@str) when (~"theme1" = @str) { content: is theme1 no quotes; }
122 .stringguard(@str) {}
124 .stringguard("theme1");
125 .stringguard("theme2");
126 .stringguard(theme1);
132 .mixin(@var) when (@var=4) {
135 .mixin(@var) when (@var=4px) {
143 .inner-locked-mixin(@x: @a) when (@a = 1) {
150 .call-inner-lock-mixin {
151 .inner-locked-mixin();