diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a7a3da..e530e18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [1.14.1](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.14.0...v1.14.1) (2023-12-09) + + +### Bug Fixes + +* oder of splice ([d03c2cf](https://github.com/CoCreate-app/CoCreate-css-parser/commit/d03c2cfd26c9f54c77ab8f1aba934df2cefcfdc2)) + # [1.14.0](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.13.0...v1.14.0) (2023-11-25) diff --git a/package.json b/package.json index cc1173e..d392ffe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cocreate/css-parser", - "version": "1.14.0", + "version": "1.14.1", "description": "A simple css-parser component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.", "keywords": [ "css-parser", diff --git a/src/index.js b/src/index.js index 7e962e0..06ec0a8 100644 --- a/src/index.js +++ b/src/index.js @@ -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)