From 2d4ec5380e9cf578e2d0f186e0e895f50b130bf3 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Fri, 25 Mar 2022 11:46:48 +0530 Subject: [PATCH] Initialize variables later --- scripts/postcss/css-url-to-variables.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/postcss/css-url-to-variables.js b/scripts/postcss/css-url-to-variables.js index 79814cb2..902e3e9d 100644 --- a/scripts/postcss/css-url-to-variables.js +++ b/scripts/postcss/css-url-to-variables.js @@ -15,12 +15,13 @@ limitations under the License. */ const valueParser = require("postcss-value-parser"); + /** * This plugin extracts content inside url() into css variables. * The extracted css variables are added to the :root section. */ let counter; -const urlVariables = new Map(); +let urlVariables; const idToPrepend = "icon-url"; function extractUrl(decl) { @@ -58,6 +59,7 @@ function addResolvedVariablesToRootSelector(root, { Rule, Declaration }) { * @type {import('postcss').PluginCreator} */ module.exports = (opts = {}) => { + urlVariables = new Map(); counter = 0; return { postcssPlugin: "postcss-url-to-variable",