From 41f6b6ab6bd52a55f024cb31d8f78c389e7f02df Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Mon, 7 Mar 2022 13:25:53 +0530 Subject: [PATCH] Use startsWith instead of regex testing --- postcss/css-compile-variables.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/postcss/css-compile-variables.js b/postcss/css-compile-variables.js index 8737067d..8d4b0fd9 100644 --- a/postcss/css-compile-variables.js +++ b/postcss/css-compile-variables.js @@ -37,9 +37,8 @@ function resolveDerivedVariable(decl, variables) { } function extractAlias(decl) { - const RE_VARIABLE_PROP = /--(.+)/; const wholeVariable = decl.value.match(RE_VARIABLE_VALUE)?.[1]; - if (RE_VARIABLE_PROP.test(decl.prop) && wholeVariable) { + if (decl.prop.startsWith("--") && wholeVariable) { aliasMap.set(decl.prop, wholeVariable); } }