diff --git a/test/css/mixins-guards.css b/test/css/mixins-guards.css new file mode 100644 index 00000000..5920d4f6 --- /dev/null +++ b/test/css/mixins-guards.css @@ -0,0 +1,20 @@ +.light1 { + color: white; + margin: 1px; +} +.light2 { + color: black; + margin: 1px; +} +.max1 { + width: 6; +} +.max2 { + width: 8; +} +.glob1 { + margin: auto auto; +} +.default1 { + content: default; +} diff --git a/test/less/mixins-guards.less b/test/less/mixins-guards.less new file mode 100644 index 00000000..dedf95b3 --- /dev/null +++ b/test/less/mixins-guards.less @@ -0,0 +1,46 @@ + +// Stacking, functions.. + +.light (@a) ? lightness(@a) > 50% { + color: white; +} +.light (@a) ? lightness(@a) < 50% { + color: black; +} +.light (@a) { + margin: 1px; +} + +.light1 { .light(#ddd) } +.light2 { .light(#444) } + +// Arguments against each other + +.max (@a, @b) ? @a > @b { + width: @a; +} +.max (@a, @b) ? @a < @b { + width: @b; +} + +.max1 { .max(3, 6) } +.max2 { .max(8, 1) } + +// Globals inside guards + +@g: auto; + +.glob (@a) ? @a = @g { + margin: @a @g; +} + +.glob1 { .glob(auto) } + +// Scope and default values + +@a: auto; + +.default (@a: inherit) ? @a = inherit { + content: default; +} +.default1 { .default }