From 41f53f2fc2f2ca514ad3a5a4e706655e039bc1d1 Mon Sep 17 00:00:00 2001 From: Luke Page Date: Thu, 11 Jul 2013 08:44:03 +0100 Subject: [PATCH] correct radial gradient format to w3c spec --- lib/less/functions.js | 5 +++-- test/less/errors/svg-gradient1.txt | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/less/functions.js b/lib/less/functions.js index 39ac6e82..cddfdb20 100644 --- a/lib/less/functions.js +++ b/lib/less/functions.js @@ -528,13 +528,14 @@ tree.functions = { case "to top right": gradientDirectionSvg = 'x1="0%" y1="100%" x2="100%" y2="0%"'; break; - case "radial": + case "ellipse": + case "ellipse at center": gradientType = "radial"; gradientDirectionSvg = 'cx="50%" cy="50%" r="75%"'; rectangleDimension = 'x="-50" y="-50" width="101" height="101"'; break default: - throw { type: "Argument", message: "svg-gradient direction must be 'to bottom', 'to right', 'to bottom right', 'to top right' or 'radial'" }; + throw { type: "Argument", message: "svg-gradient direction must be 'to bottom', 'to right', 'to bottom right', 'to top right' or 'ellipse at center'" }; } returner = '' + '' + diff --git a/test/less/errors/svg-gradient1.txt b/test/less/errors/svg-gradient1.txt index c31bcb98..ec662fe6 100644 --- a/test/less/errors/svg-gradient1.txt +++ b/test/less/errors/svg-gradient1.txt @@ -1,4 +1,4 @@ -ArgumentError: error evaluating function `svg-gradient`: svg-gradient direction must be 'to bottom', 'to right', 'to bottom right', 'to top right' or 'radial' in {path}svg-gradient1.less on line 2, column 6: +ArgumentError: error evaluating function `svg-gradient`: svg-gradient direction must be 'to bottom', 'to right', 'to bottom right', 'to top right' or 'ellipse at center' in {path}svg-gradient1.less on line 2, column 6: 1 .a { 2 a: svg-gradient(horizontal, black, white); 3 }