Skip to content

Commit

Permalink
fix: use toString on properties in replaceSymbols (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi authored May 29, 2019
1 parent 710954e commit ba961e8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/replaceSymbols.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@ import replaceValueSymbols from "./replaceValueSymbols.js";
const replaceSymbols = (css, replacements) => {
css.walk(node => {
if (node.type === "decl" && node.value) {
node.value = replaceValueSymbols(node.value, replacements);
node.value = replaceValueSymbols(node.value.toString(), replacements);
} else if (node.type === "rule" && node.selector) {
node.selector = replaceValueSymbols(node.selector, replacements);
node.selector = replaceValueSymbols(
node.selector.toString(),
replacements
);
} else if (
node.type === "atrule" &&
node.params &&
["media", "supports"].includes(node.name.toLowerCase())
) {
node.params = replaceValueSymbols(node.params, replacements);
node.params = replaceValueSymbols(node.params.toString(), replacements);
}
});
};
Expand Down

0 comments on commit ba961e8

Please sign in to comment.