diff --git a/postcss/css-compile-variables.js b/postcss/css-compile-variables.js index 195526ef..732ed8b3 100644 --- a/postcss/css-compile-variables.js +++ b/postcss/css-compile-variables.js @@ -44,13 +44,10 @@ function resolveDerivedVariable(decl, {variables, derive}) { const matches = variable.match(RE_VARIABLE_VALUE); if (matches) { const [wholeVariable, baseVariable, operation, argument] = matches; - if (!variables[baseVariable]) { - // hmm.. baseVariable should be in config..., maybe this is an alias? - if (!aliasMap.get(`--${baseVariable}`)) { - throw new Error(`Cannot derive from ${baseVariable} because it is neither defined in config nor is it an alias!`); - } - } const value = variables[baseVariable] ?? getValueFromAlias(baseVariable, variables); + if (!value) { + throw new Error(`Cannot derive from ${baseVariable} because it is neither defined in config nor is it an alias!`); + } const derivedValue = derive(value, operation, argument); resolvedMap.set(wholeVariable, derivedValue); }