Skip to content

Commit 41f53f2

Browse files
committed
correct radial gradient format to w3c spec
1 parent c68352d commit 41f53f2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/less/functions.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,13 +528,14 @@ tree.functions = {
528528
case "to top right":
529529
gradientDirectionSvg = 'x1="0%" y1="100%" x2="100%" y2="0%"';
530530
break;
531-
case "radial":
531+
case "ellipse":
532+
case "ellipse at center":
532533
gradientType = "radial";
533534
gradientDirectionSvg = 'cx="50%" cy="50%" r="75%"';
534535
rectangleDimension = 'x="-50" y="-50" width="101" height="101"';
535536
break
536537
default:
537-
throw { type: "Argument", message: "svg-gradient direction must be 'to bottom', 'to right', 'to bottom right', 'to top right' or 'radial'" };
538+
throw { type: "Argument", message: "svg-gradient direction must be 'to bottom', 'to right', 'to bottom right', 'to top right' or 'ellipse at center'" };
538539
}
539540
returner = '<?xml version="1.0" ?>' +
540541
'<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none">' +

test/less/errors/svg-gradient1.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
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:
1+
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:
22
1 .a {
33
2 a: svg-gradient(horizontal, black, white);
44
3 }

0 commit comments

Comments
 (0)