Skip to content

Commit

Permalink
fix: cannot reduce cssRules collection
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremenichelli committed Aug 8, 2019
1 parent 9faeb4e commit 162df8d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}}`
Expand Down

0 comments on commit 162df8d

Please sign in to comment.