Skip to content

Commit 1450a16

Browse files
Merge pull request #94 from XhmikosR/patch-1
Fix postcss deprecation warning about `moveTo`.
2 parents cafbcf7 + 387b5cc commit 1450a16

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ module.exports = postcss.plugin(name, (options) => {
9999
const destination = map.get(selector);
100100
// move declarations to original rule
101101
while (rule.nodes.length > 0) {
102-
rule.nodes[0].moveTo(destination);
102+
destination.append(rule.nodes[0]);
103103
}
104104
// remove duplicated rule
105105
rule.remove();

test/duplicated-css.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ test(
210210
'selectors with multiple properties',
211211
css,
212212
'.a {color: black; height: 10px} .a {background-color: red; width: 20px}',
213-
'.a {color: black; height: 10px; background-color: red; width: 20px}'
213+
'.a {color: black; height: 10px;background-color: red; width: 20px}'
214214
);
215215

216216
test(

test/duplicated-properties.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ test(
1717
'remove duplicated properties when combine selectors',
1818
removeDuplicates,
1919
'.a {height: 10px; color: black;} .a {color: blue; width: 20px;}',
20-
'.a {height: 10px; color: blue; width: 20px;}'
20+
'.a {height: 10px;color: blue; width: 20px;}'
2121
);
2222

2323
test(
@@ -37,7 +37,7 @@ test(
3737
'maintain duplicated properties when combine selectors',
3838
keepDuplicates,
3939
'.a {height: 10px; color: black;} .a {color: blue; width: 20px;}',
40-
'.a {height: 10px; color: black; color: blue; width: 20px;}'
40+
'.a {height: 10px; color: black;color: blue; width: 20px;}'
4141
);
4242

4343
test(

0 commit comments

Comments
 (0)