mirror of
https://github.com/less/less.js.git
synced 2026-01-22 21:58:14 -05:00
Add function percentage
This commit is contained in:
@@ -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, '%');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
lightness: 95%;
|
||||
rounded: 11;
|
||||
roundedpx: 3px;
|
||||
percentage: 20%;
|
||||
}
|
||||
#alpha {
|
||||
alpha: rgba(153, 94, 51, 0.6);
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
lightness: lightness(hsl(98, 12%, 95%));
|
||||
rounded: round(@r/3);
|
||||
roundedpx: round(10px / 3);
|
||||
percentage: percentage(10px / 50);
|
||||
}
|
||||
|
||||
#alpha {
|
||||
|
||||
Reference in New Issue
Block a user