Skip to content

Commit d03c2cf

Browse files
committed
fix: oder of splice
1 parent eafce3e commit d03c2cf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,14 +275,15 @@ function addNewRules() {
275275
low = index + 1;
276276
}
277277

278-
if (low > styleElSheet.cssRules.length) low = styleElSheet.cssRules.length;
278+
if (low > styleElSheet.cssRules.length)
279+
low = styleElSheet.cssRules.length;
279280
try {
280281
styleElSheet.insertRule(rule, low);
282+
parsedCSS.splice(low, 0, rule);
281283
}
282284
catch (err) {
283285
console.error(err);
284286
}
285-
parsedCSS.splice(low, 0, rule);
286287
}
287288
if (tempStyleList.length > 0)
288289
if (linkTag.save)

0 commit comments

Comments
 (0)