Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.6.0 #3278

Merged
merged 1 commit into from
Jul 10, 2018
Merged

v3.6.0 #3278

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 31 additions & 26 deletions dist/less.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Less - Leaner CSS v3.5.3
* Less - Leaner CSS v3.6.0
* http://lesscss.org
*
* Copyright (c) 2009-2018, Alexis Sellier <self@cloudhead.net>
Expand Down Expand Up @@ -2590,9 +2590,8 @@ module.exports = function(environment) {
throw { type: 'Argument', message: 'svg-gradient direction must be \'to bottom\', \'to right\',' +
' \'to bottom right\', \'to top right\' or \'ellipse at center\'' };
}
returner = '<?xml version="1.0" ?>' +
'<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none">' +
'<' + gradientType + 'Gradient id="gradient" gradientUnits="userSpaceOnUse" ' + gradientDirectionSvg + '>';
returner = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1 1">' +
'<' + gradientType + 'Gradient id="g" ' + gradientDirectionSvg + '>';

for (i = 0; i < stops.length; i += 1) {
if (stops[i] instanceof Expression) {
Expand All @@ -2611,7 +2610,7 @@ module.exports = function(environment) {
returner += '<stop offset="' + positionValue + '" stop-color="' + color.toRGB() + '"' + (alpha < 1 ? ' stop-opacity="' + alpha + '"' : '') + '/>';
}
returner += '</' + gradientType + 'Gradient>' +
'<rect ' + rectangleDimension + ' fill="url(#gradient)" /></svg>';
'<rect ' + rectangleDimension + ' fill="url(#g)" /></svg>';

returner = encodeURIComponent(returner);

Expand Down Expand Up @@ -2888,7 +2887,7 @@ module.exports = function(environment, fileManagers) {
var SourceMapOutput, SourceMapBuilder, ParseTree, ImportManager, Environment;

var initial = {
version: [3, 5, 3],
version: [3, 6, 0],
data: require('./data'),
tree: require('./tree'),
Environment: (Environment = require('./environment/environment')),
Expand Down Expand Up @@ -3830,14 +3829,16 @@ var Parser = function Parser(context, imports, fileInfo) {
);
}

function expect(arg, msg, index) {
function expect(arg, msg) {
// some older browsers return typeof 'function' for RegExp
var result = (arg instanceof Function) ? arg.call(parsers) : parserInput.$re(arg);
if (result) {
return result;
}
error(msg || (typeof arg === 'string' ? 'expected \'' + arg + '\' got \'' + parserInput.currentChar() + '\''
: 'unexpected token'));

error(msg || (typeof arg === 'string'
? 'expected \'' + arg + '\' got \'' + parserInput.currentChar() + '\''
: 'unexpected token'));
}

// Specialization of expect()
Expand Down Expand Up @@ -5739,13 +5740,13 @@ var Parser = function Parser(context, imports, fileInfo) {
conditions: function () {
var a, b, index = parserInput.i, condition;

a = this.condition();
a = this.condition(true);
if (a) {
while (true) {
if (!parserInput.peek(/^,\s*(not\s*)?\(/) || !parserInput.$char(',')) {
break;
}
b = this.condition();
b = this.condition(true);
if (!b) {
break;
}
Expand All @@ -5754,19 +5755,19 @@ var Parser = function Parser(context, imports, fileInfo) {
return condition || a;
}
},
condition: function () {
condition: function (needsParens) {
var result, logical, next;
function or() {
return parserInput.$str('or');
}

result = this.conditionAnd(this);
result = this.conditionAnd(needsParens);
if (!result) {
return ;
}
logical = or();
if (logical) {
next = this.condition();
next = this.condition(needsParens);
if (next) {
result = new(tree.Condition)(logical, result, next);
} else {
Expand All @@ -5775,22 +5776,26 @@ var Parser = function Parser(context, imports, fileInfo) {
}
return result;
},
conditionAnd: function () {
var result, logical, next;
function insideCondition(me) {
return me.negatedCondition() || me.parenthesisCondition();
conditionAnd: function (needsParens) {
var result, logical, next, self = this;
function insideCondition() {
var cond = self.negatedCondition(needsParens) || self.parenthesisCondition(needsParens);
if (!cond && !needsParens) {
return self.atomicCondition(needsParens);
}
return cond;
}
function and() {
return parserInput.$str('and');
}

result = insideCondition(this);
result = insideCondition();
if (!result) {
return ;
}
logical = and();
if (logical) {
next = this.conditionAnd();
next = this.conditionAnd(needsParens);
if (next) {
result = new(tree.Condition)(logical, result, next);
} else {
Expand All @@ -5799,20 +5804,20 @@ var Parser = function Parser(context, imports, fileInfo) {
}
return result;
},
negatedCondition: function () {
negatedCondition: function (needsParens) {
if (parserInput.$str('not')) {
var result = this.parenthesisCondition();
var result = this.parenthesisCondition(needsParens);
if (result) {
result.negate = !result.negate;
}
return result;
}
},
parenthesisCondition: function () {
parenthesisCondition: function (needsParens) {
function tryConditionFollowedByParenthesis(me) {
var body;
parserInput.save();
body = me.condition();
body = me.condition(needsParens);
if (!body) {
parserInput.restore();
return ;
Expand All @@ -5837,7 +5842,7 @@ var Parser = function Parser(context, imports, fileInfo) {
return body;
}

body = this.atomicCondition();
body = this.atomicCondition(needsParens);
if (!body) {
parserInput.restore();
return ;
Expand All @@ -5849,7 +5854,7 @@ var Parser = function Parser(context, imports, fileInfo) {
parserInput.forget();
return body;
},
atomicCondition: function () {
atomicCondition: function (needsParens) {
var entities = this.entities, index = parserInput.i, a, b, c, op;

function cond() {
Expand Down
12 changes: 6 additions & 6 deletions dist/less.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/less/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = function(environment, fileManagers) {
var SourceMapOutput, SourceMapBuilder, ParseTree, ImportManager, Environment;

var initial = {
version: [3, 5, 3],
version: [3, 6, 0],
data: require('./data'),
tree: require('./tree'),
Environment: (Environment = require('./environment/environment')),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "less",
"version": "3.5.3",
"version": "3.6.0",
"description": "Leaner CSS",
"homepage": "http://lesscss.org",
"author": {
Expand Down