diff --git a/CHANGELOG.md b/CHANGELOG.md index f7d1b59..4611ffd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [1.2.0](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.1.13...v1.2.0) (2022-12-09) + + +### Features + +* set cssParser true or false from localStorage ([3270345](https://github.com/CoCreate-app/CoCreate-css-parser/commit/3270345dbc6731c53bda766734c57a4281f05c49)) + ## [1.1.13](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.1.12...v1.1.13) (2022-12-09) diff --git a/package.json b/package.json index ab96a59..57e20c1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cocreate/css-parser", - "version": "1.1.13", + "version": "1.2.0", "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 7afc60a..fa12f05 100644 --- a/src/index.js +++ b/src/index.js @@ -37,15 +37,17 @@ function init() { styleEl.setAttribute('component', 'CoCreateCss'); document.head.appendChild(styleEl); styleElSheet = styleEl.sheet; - - parseLinkCSS(); + if (parse == undefined) + parse = window.localStorage.getItem('cssParser') + if (parse != 'false') { + parseLinkCSS(); let elements = document.querySelectorAll("[class]"); initElements(elements); + observerInit(); } - observerInit(); } }