Files
less.js/test/less/functions.less
2012-01-03 19:01:47 +01:00

50 lines
1.3 KiB
Plaintext

#functions {
@var: 10;
color: _color("evil red"); // #660000
width: increment(15);
height: undefined("self");
border-width: add(2, 3);
variable: increment(@var);
}
#built-in {
@r: 32;
escaped: e("-Some::weird(#thing, y)");
lighten: lighten(#ff0000, 40%);
darken: darken(#ff0000, 40%);
saturate: saturate(#29332f, 20%);
desaturate: desaturate(#203c31, 20%);
greyscale: greyscale(#203c31);
spin-p: spin(hsl(340, 50%, 50%), 40);
spin-n: spin(hsl(30, 50%, 50%), -40);
format: %("rgb(%d, %d, %d)", @r, 128, 64);
format-string: %("hello %s", "world");
format-multiple: %("hello %s %d", "earth", 2);
format-url-encode: %('red is %A', #ff0000);
eformat: e(%("rgb(%d, %d, %d)", @r, 128, 64));
hue: hue(hsl(98, 12%, 95%));
saturation: saturation(hsl(98, 12%, 95%));
lightness: lightness(hsl(98, 12%, 95%));
rounded: round(@r/3);
roundedpx: round(10px / 3);
percentage: percentage(10px / 50);
color: color("#ff0011");
.is-a {
color: is-color(#ddd);
color: is-color(red);
color: is-color(rgb(0, 0, 0));
keyword: is-keyword(hello);
number: is-number(32);
string: is-string("hello");
pixel: is-pixel(32px);
percent: is-percentage(32%);
em: is-em(32em);
}
}
#alpha {
alpha: darken(hsla(25, 50%, 50%, 0.6), 10%);
}