From 5d4323cd1dcabaacdfb98bb0b44ce09cc25a739d Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Wed, 23 Mar 2022 17:12:14 +0530 Subject: [PATCH] Remove stray "--" from code --- scripts/postcss/css-compile-variables.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/postcss/css-compile-variables.js b/scripts/postcss/css-compile-variables.js index ea939780..23795145 100644 --- a/scripts/postcss/css-compile-variables.js +++ b/scripts/postcss/css-compile-variables.js @@ -21,7 +21,7 @@ let resolvedMap; let baseVariables; function getValueFromAlias(alias) { - const derivedVariable = aliasMap.get(`--${alias}`); + const derivedVariable = aliasMap.get(alias); return baseVariables.get(derivedVariable) ?? resolvedMap.get(derivedVariable); } @@ -39,13 +39,13 @@ function parseDeclarationValue(value) { } function resolveDerivedVariable(decl, derive) { - const RE_VARIABLE_VALUE = /--(.+)--(.+)-(.+)/; + const RE_VARIABLE_VALUE = /(--.+)--(.+)-(.+)/; const variableCollection = parseDeclarationValue(decl.value); for (const variable of variableCollection) { const matches = variable.match(RE_VARIABLE_VALUE); if (matches) { const [wholeVariable, baseVariable, operation, argument] = matches; - const value = baseVariables.get(`--${baseVariable}`) ?? getValueFromAlias(baseVariable); + const value = baseVariables.get(baseVariable) ?? getValueFromAlias(baseVariable); if (!value) { throw new Error(`Cannot derive from ${baseVariable} because it is neither defined in config nor is it an alias!`); }