source: trip-planner-front/node_modules/icss-utils/src/replaceSymbols.js@ 6a80231

Last change on this file since 6a80231 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 607 bytes
Line 
1const replaceValueSymbols = require("./replaceValueSymbols.js");
2
3const replaceSymbols = (css, replacements) => {
4 css.walk((node) => {
5 if (node.type === "decl" && node.value) {
6 node.value = replaceValueSymbols(node.value.toString(), replacements);
7 } else if (node.type === "rule" && node.selector) {
8 node.selector = replaceValueSymbols(
9 node.selector.toString(),
10 replacements
11 );
12 } else if (node.type === "atrule" && node.params) {
13 node.params = replaceValueSymbols(node.params.toString(), replacements);
14 }
15 });
16};
17
18module.exports = replaceSymbols;
Note: See TracBrowser for help on using the repository browser.