mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Legacy maths mode supports old special cases for font property and media queries
This commit is contained in:
@@ -27,7 +27,19 @@ tree.Media.prototype = {
|
||||
this.ruleset.debugInfo = this.debugInfo;
|
||||
media.debugInfo = this.debugInfo;
|
||||
}
|
||||
media.features = this.features.eval(env);
|
||||
var strictMathsBypass = false;
|
||||
if (env.strictMaths === false) {
|
||||
strictMathsBypass = true;
|
||||
env.strictMaths = true;
|
||||
}
|
||||
try {
|
||||
media.features = this.features.eval(env);
|
||||
}
|
||||
finally {
|
||||
if (strictMathsBypass) {
|
||||
env.strictMaths = false;
|
||||
}
|
||||
}
|
||||
|
||||
env.mediaPath.push(media);
|
||||
env.mediaBlocks.push(media);
|
||||
|
||||
@@ -20,11 +20,23 @@ tree.Rule.prototype.toCSS = function (env) {
|
||||
}
|
||||
};
|
||||
|
||||
tree.Rule.prototype.eval = function (context) {
|
||||
return new(tree.Rule)(this.name,
|
||||
this.value.eval(context),
|
||||
tree.Rule.prototype.eval = function (env) {
|
||||
var strictMathsBypass = false;
|
||||
if (this.name === "font" && env.strictMaths === false) {
|
||||
strictMathsBypass = true;
|
||||
env.strictMaths = true;
|
||||
}
|
||||
try {
|
||||
return new(tree.Rule)(this.name,
|
||||
this.value.eval(env),
|
||||
this.important,
|
||||
this.index, this.inline);
|
||||
}
|
||||
finally {
|
||||
if (strictMathsBypass) {
|
||||
env.strictMaths = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
tree.Rule.prototype.makeImportant = function () {
|
||||
|
||||
Reference in New Issue
Block a user