From a268310dd244d9b6083f3c435959e8713814e68e Mon Sep 17 00:00:00 2001 From: sra1kumar-NULL Date: Tue, 12 Nov 2024 16:51:22 +0530 Subject: [PATCH] fix: added String.raw for literals --- .github/workflows/next-latest.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/next-latest.yml b/.github/workflows/next-latest.yml index 7e39034e7..8628c93db 100644 --- a/.github/workflows/next-latest.yml +++ b/.github/workflows/next-latest.yml @@ -140,17 +140,17 @@ jobs: mode?: "light" | "dark" | "system"; children?: React.ReactNode; }) { - let cssVariablesWithMode = `/* empty */` + let cssVariablesWithMode = String.raw`/* empty */` Object.keys(config).forEach((configKey) => { cssVariablesWithMode += - configKey === "dark" ? `\n .dark {\n ` : `\n:root {\n`; + configKey === "dark" ? String.raw`\n .dark {\n ` : String.raw`\n:root {\n`; const cssVariables = Object.keys( config[configKey as keyof typeof config] ).reduce((acc: string, curr: string) => { - acc += `${curr}:${config[configKey as keyof typeof config][curr]}; `; + acc += String.raw`${curr}:${config[configKey as keyof typeof config][curr]}; `; return acc; }, ""); - cssVariablesWithMode += `${cssVariables} \n}`; + cssVariablesWithMode += String.raw`${cssVariables} \n}`; }); setFlushStyles(cssVariablesWithMode); @@ -184,7 +184,7 @@ jobs: const documentElement = document.documentElement; if (documentElement) { const head = documentElement.querySelector("head"); - let style = head?.querySelector(`[id='${variableStyleTagId}']`); + let style = head?.querySelector(String.raw`[id='${variableStyleTagId}']`); if (!style) { style = createStyle(variableStyleTagId); style.innerHTML = cssVariablesWithMode;