@stylable/core
Advanced tools
Comparing version 5.2.0 to 5.2.1
@@ -108,18 +108,29 @@ "use strict"; | ||
} | ||
else if (valueNodes.length === 1) { | ||
const valueNode = valueNodes[0]; | ||
resolvedValue = valueNode.resolvedValue; | ||
if (!resolvedValue) { | ||
const ct = customTypes[valueNode.value]; | ||
if (valueNode.type === 'function' && ct) { | ||
resolvedValue = ct.evalVarAst(valueNode, customTypes, boxPrimitive); | ||
else { | ||
const nonComments = valueNodes.filter((node) => node.type !== 'comment'); | ||
if (nonComments.length === 1) { | ||
const valueNode = nonComments[0]; | ||
resolvedValue = valueNode.resolvedValue; | ||
if (!resolvedValue) { | ||
const ct = customTypes[valueNode.value]; | ||
if (valueNode.type === 'function' && ct) { | ||
resolvedValue = ct.evalVarAst(valueNode, customTypes, boxPrimitive); | ||
} | ||
else { | ||
resolvedValue = unbox((0, value_1.getStringValue)(valueNode), !boxPrimitive); | ||
} | ||
} | ||
else { | ||
resolvedValue = unbox((0, value_1.getStringValue)(valueNode), !boxPrimitive); | ||
else if (typeof resolvedValue === 'string') { | ||
const parsedArg = (0, postcss_value_parser_1.default)(resolvedValue).nodes[0]; | ||
const ct = parsedArg.type === 'function' && parsedArg.value; | ||
resolvedValue = | ||
typeof ct === 'string' && customTypes[ct] | ||
? customTypes[ct].evalVarAst(parsedArg, customTypes, boxPrimitive) | ||
: unbox(resolvedValue, !boxPrimitive); | ||
} | ||
} | ||
else { | ||
resolvedValue = unbox((0, value_1.getStringValue)(valueNodes), !boxPrimitive); | ||
} | ||
} | ||
else { | ||
resolvedValue = unbox((0, value_1.getStringValue)(valueNodes), !boxPrimitive); | ||
} | ||
if (resolvedValue) { | ||
@@ -126,0 +137,0 @@ outputMap[prop.value] = resolvedValue; |
{ | ||
"name": "@stylable/core", | ||
"version": "5.2.0", | ||
"version": "5.2.1", | ||
"description": "CSS for Components", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -146,16 +146,26 @@ import cloneDeepWith from 'lodash.clonedeepwith'; | ||
// TODO: error | ||
} else if (valueNodes.length === 1) { | ||
const valueNode = valueNodes[0]; | ||
resolvedValue = valueNode.resolvedValue; | ||
} else { | ||
const nonComments = valueNodes.filter((node) => node.type !== 'comment'); | ||
if (nonComments.length === 1) { | ||
const valueNode = nonComments[0]; | ||
resolvedValue = valueNode.resolvedValue; | ||
if (!resolvedValue) { | ||
const ct = customTypes[valueNode.value]; | ||
if (valueNode.type === 'function' && ct) { | ||
resolvedValue = ct.evalVarAst(valueNode, customTypes, boxPrimitive); | ||
} else { | ||
resolvedValue = unbox(getStringValue(valueNode), !boxPrimitive); | ||
if (!resolvedValue) { | ||
const ct = customTypes[valueNode.value]; | ||
if (valueNode.type === 'function' && ct) { | ||
resolvedValue = ct.evalVarAst(valueNode, customTypes, boxPrimitive); | ||
} else { | ||
resolvedValue = unbox(getStringValue(valueNode), !boxPrimitive); | ||
} | ||
} else if (typeof resolvedValue === 'string') { | ||
const parsedArg = postcssValueParser(resolvedValue).nodes[0]; | ||
const ct = parsedArg.type === 'function' && parsedArg.value; | ||
resolvedValue = | ||
typeof ct === 'string' && customTypes[ct] | ||
? customTypes[ct].evalVarAst(parsedArg, customTypes, boxPrimitive) | ||
: unbox(resolvedValue, !boxPrimitive); | ||
} | ||
} else { | ||
resolvedValue = unbox(getStringValue(valueNodes), !boxPrimitive); | ||
} | ||
} else { | ||
resolvedValue = unbox(getStringValue(valueNodes), !boxPrimitive); | ||
} | ||
@@ -162,0 +172,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1098493
19660