(test) mixin-guards

This commit is contained in:
Alexis Sellier
2011-12-24 13:32:43 +01:00
parent 626d7f1523
commit 624c297e7b
2 changed files with 66 additions and 0 deletions

View File

@@ -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;
}

View File

@@ -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 }