Last change
on this file since fa375fe was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
607 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | const replaceValueSymbols = require("./replaceValueSymbols.js");
|
---|
| 2 |
|
---|
| 3 | const 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 |
|
---|
| 18 | module.exports = replaceSymbols;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.