mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Experimental support for "property name interpolation", part-2.
This commit is contained in:
@@ -8,7 +8,7 @@ tree.Rule = function (name, value, important, merge, index, currentFileInfo, inl
|
||||
this.index = index;
|
||||
this.currentFileInfo = currentFileInfo;
|
||||
this.inline = inline || false;
|
||||
this.variable = (name.charAt(0) === '@');
|
||||
this.variable = name.charAt && (name.charAt(0) === '@');
|
||||
};
|
||||
|
||||
tree.Rule.prototype = {
|
||||
@@ -31,12 +31,16 @@ tree.Rule.prototype = {
|
||||
toCSS: tree.toCSS,
|
||||
eval: function (env) {
|
||||
var strictMathBypass = false;
|
||||
if (this.name === "font" && !env.strictMath) {
|
||||
var name = this.name.map ?
|
||||
this.name.map( function(v) {
|
||||
return v.eval ? v.eval(env).value : v;
|
||||
}).join('') : this.name;
|
||||
if (name === "font" && !env.strictMath) {
|
||||
strictMathBypass = true;
|
||||
env.strictMath = true;
|
||||
}
|
||||
try {
|
||||
return new(tree.Rule)(this.name,
|
||||
return new(tree.Rule)(name,
|
||||
this.value.eval(env),
|
||||
this.important,
|
||||
this.merge,
|
||||
|
||||
Reference in New Issue
Block a user