mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Merge https://github.com/less/less.js into nested-directives-in-directives-v2-1691-2104
This commit is contained in:
@@ -8,23 +8,31 @@ module.exports = function(environment) {
|
||||
|
||||
functionRegistry.add("svg-gradient", function(direction) {
|
||||
|
||||
function throwArgumentDescriptor() {
|
||||
throw { type: "Argument",
|
||||
message: "svg-gradient expects direction, start_color [start_position], [color position,]...," +
|
||||
" end_color [end_position]" };
|
||||
}
|
||||
|
||||
if (arguments.length < 3) {
|
||||
throwArgumentDescriptor();
|
||||
}
|
||||
var stops = Array.prototype.slice.call(arguments, 1),
|
||||
var stops,
|
||||
gradientDirectionSvg,
|
||||
gradientType = "linear",
|
||||
rectangleDimension = 'x="0" y="0" width="1" height="1"',
|
||||
renderEnv = {compress: false},
|
||||
returner,
|
||||
directionValue = direction.toCSS(renderEnv),
|
||||
i, color, position, positionValue, alpha;
|
||||
i, color, position, positionValue, alpha;
|
||||
|
||||
function throwArgumentDescriptor() {
|
||||
throw { type: "Argument",
|
||||
message: "svg-gradient expects direction, start_color [start_position], [color position,]...," +
|
||||
" end_color [end_position] or direction, color list" };
|
||||
}
|
||||
|
||||
if (arguments.length == 2) {
|
||||
if (arguments[1].value.length < 2) {
|
||||
throwArgumentDescriptor();
|
||||
}
|
||||
stops = arguments[1].value;
|
||||
} else if (arguments.length < 3) {
|
||||
throwArgumentDescriptor();
|
||||
} else {
|
||||
stops = Array.prototype.slice.call(arguments, 1);
|
||||
}
|
||||
|
||||
switch (directionValue) {
|
||||
case "to bottom":
|
||||
|
||||
Reference in New Issue
Block a user