Remove css specific syntax from map

This commit is contained in:
RMidhunSuresh 2022-03-25 15:48:32 +05:30
parent 2d4ec5380e
commit f07a3ea5b5

View file

@ -33,7 +33,7 @@ function extractUrl(decl) {
} }
const urlStringNode = node.nodes[0]; const urlStringNode = node.nodes[0];
const variableName = `${idToPrepend}-${counter++}`; const variableName = `${idToPrepend}-${counter++}`;
urlVariables.set(variableName, `"${urlStringNode.value}"`); urlVariables.set(variableName, urlStringNode.value);
const varNode = { const varNode = {
type: "function", type: "function",
value: "var", value: "var",
@ -49,7 +49,7 @@ function addResolvedVariablesToRootSelector(root, { Rule, Declaration }) {
const newRule = new Rule({ selector: ":root", source: root.source }); const newRule = new Rule({ selector: ":root", source: root.source });
// Add derived css variables to :root // Add derived css variables to :root
urlVariables.forEach((value, key) => { urlVariables.forEach((value, key) => {
const declaration = new Declaration({ prop: `--${key}`, value }); const declaration = new Declaration({ prop: `--${key}`, value: `"${value}"`});
newRule.append(declaration); newRule.append(declaration);
}); });
root.append(newRule); root.append(newRule);