diff --git a/lib/less/functions.js b/lib/less/functions.js index d5fe8678..1aaa0d4c 100644 --- a/lib/less/functions.js +++ b/lib/less/functions.js @@ -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, '%'); } }; diff --git a/test/css/functions.css b/test/css/functions.css index f33b9869..810af0df 100644 --- a/test/css/functions.css +++ b/test/css/functions.css @@ -24,6 +24,7 @@ lightness: 95%; rounded: 11; roundedpx: 3px; + percentage: 20%; } #alpha { alpha: rgba(153, 94, 51, 0.6); diff --git a/test/less/functions.less b/test/less/functions.less index 1af78bc8..27b4d0bc 100644 --- a/test/less/functions.less +++ b/test/less/functions.less @@ -28,6 +28,7 @@ lightness: lightness(hsl(98, 12%, 95%)); rounded: round(@r/3); roundedpx: round(10px / 3); + percentage: percentage(10px / 50); } #alpha {