Skip to content

Commit

Permalink
fix: handle all at-rules (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi authored May 29, 2019
1 parent ba961e8 commit f053c4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 1 addition & 5 deletions src/replaceSymbols.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ const replaceSymbols = (css, replacements) => {
node.selector.toString(),
replacements
);
} else if (
node.type === "atrule" &&
node.params &&
["media", "supports"].includes(node.name.toLowerCase())
) {
} else if (node.type === "atrule" && node.params) {
node.params = replaceValueSymbols(node.params.toString(), replacements);
}
});
Expand Down
6 changes: 4 additions & 2 deletions test/replaceSymbols.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ test("not change property names", () => {
);
});

test("not change non-media at-rules", () => {
expect(replace("@import url;", { url: "otherUrl" })).toEqual("@import url;");
test("change non-media at-rules", () => {
expect(replace("@import url;", { url: "otherUrl" })).toEqual(
"@import otherUrl;"
);
});

test("change declaration values", () => {
Expand Down

0 comments on commit f053c4c

Please sign in to comment.