Experimental support for "property name interpolation", part-2.

This commit is contained in:
seven-phases-max
2013-12-18 07:10:00 +04:00
parent 4fd9704266
commit ebdadaedac
2 changed files with 37 additions and 12 deletions

View File

@@ -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,