Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow replacing stylesheet to preserve the cascade
Usually this library will append media queries in separate <style> elements. However, doing this changes the cascade such that a media rule will be used over a non-media rule. This is because the media rule is removed from its position and appended after everything else. It is a common case that a non-media rule will override a media rule, so this inversion of the cascade makes it very difficult to style for all browsers using this polyfill. Turn on this option by setting `window.RESPOND_REPLACE_STYLES = true` before sourcing this script. It will remove every stylesheet it finds and move all CSS into the `media="all"` stylesheet that is appended, minus the inactive media query rules and those of other media types, like print. The other types are appended in the usual manner.
- Loading branch information