Skip to content

Commit

Permalink
fix: oder of splice
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Nov 28, 2023
1 parent eafce3e commit d03c2cf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,14 +275,15 @@ function addNewRules() {
low = index + 1;
}

if (low > styleElSheet.cssRules.length) low = styleElSheet.cssRules.length;
if (low > styleElSheet.cssRules.length)
low = styleElSheet.cssRules.length;
try {
styleElSheet.insertRule(rule, low);
parsedCSS.splice(low, 0, rule);
}
catch (err) {
console.error(err);
}
parsedCSS.splice(low, 0, rule);
}
if (tempStyleList.length > 0)
if (linkTag.save)
Expand Down

0 comments on commit d03c2cf

Please sign in to comment.