Add function percentage

This commit is contained in:
hokaccha
2011-12-15 11:10:53 +09:00
parent 9e48460eff
commit b00aee79d6
3 changed files with 5 additions and 0 deletions

View File

@@ -167,6 +167,9 @@ tree.functions = {
argb: function (color) {
return new(tree.Anonymous)(color.toARGB());
},
percentage: function(n) {
return new(tree.Dimension)(n.value * 100, '%');
}
};

View File

@@ -24,6 +24,7 @@
lightness: 95%;
rounded: 11;
roundedpx: 3px;
percentage: 20%;
}
#alpha {
alpha: rgba(153, 94, 51, 0.6);

View File

@@ -28,6 +28,7 @@
lightness: lightness(hsl(98, 12%, 95%));
rounded: round(@r/3);
roundedpx: round(10px / 3);
percentage: percentage(10px / 50);
}
#alpha {