From 162df8d4e51521a653d22c36284c515a2917968c Mon Sep 17 00:00:00 2001 From: Jere Menichelli Date: Thu, 8 Aug 2019 11:31:20 +0200 Subject: [PATCH] fix: cannot reduce cssRules collection --- src/css.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/css.js b/src/css.js index 3b376da..5eb8540 100644 --- a/src/css.js +++ b/src/css.js @@ -19,9 +19,10 @@ function __onload__(media, storage, logger) { if (storage) { try { const rules = this.sheet ? this.sheet.cssRules : this.styleSheet.rules - let styles = rules.reduce((acc, rule) => { - return (acc += rule.cssText) - }, '') + let styles = '' + for (var i = 0, len = rules.length; i < len; i++) { + styles += rules[i].cssText + } // wrap rules with @media statement if necessary if (media) styles = `@media ${media} {${styles}}`