Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug where styles have their media queries removed on IE
In IE 9, appending two styles with media queries to a `StyleSheet`'s `cssText` property results in the first style's media query being removed and that first style will always apply without the query. For example: ``` var styleTag = document.createElement('style'); document.body.appendChild(styleTag); styleTag.styleSheet.cssText += '@media (min-width: 500px) { body { background-color: blue; } }'; styleTag.styleSheet.cssText += '@media (min-width: 700px) { body { background-color: red; } }'; ``` Causes the body element to be red for window widths ≥ 700px, but it is blue otherwise, even at widths < 500px. This change uses the `innerText` property of the `styleTag` element instead, which avoids this issue.
- Loading branch information