Skip to content
This repository was archived by the owner on Mar 13, 2018. It is now read-only.

Commit a66279f

Browse files
committed
Make body[unresolved] function correctly on IE when body contains non-statically positioned
1 parent a0f8e63 commit a66279f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/unresolved.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,22 @@
99

1010
(function(scope) {
1111

12-
// TODO(sorvell): It's desireable to provide a default stylesheet
12+
// It's desireable to provide a default stylesheet
1313
// that's convenient for styling unresolved elements, but
1414
// it's cumbersome to have to include this manually in every page.
1515
// It would make sense to put inside some HTMLImport but
1616
// the HTMLImports polyfill does not allow loading of stylesheets
1717
// that block rendering. Therefore this injection is tolerated here.
18-
18+
//
19+
// NOTE: position: relative fixes IE's failure to inherit opacity
20+
// when a child is not statically positioned.
1921
var style = document.createElement('style');
2022
style.textContent = ''
2123
+ 'body {'
2224
+ 'transition: opacity ease-in 0.2s;'
2325
+ ' } \n'
2426
+ 'body[unresolved] {'
25-
+ 'opacity: 0; display: block; overflow: hidden;'
27+
+ 'opacity: 0; display: block; overflow: hidden; position: relative;'
2628
+ ' } \n'
2729
;
2830
var head = document.querySelector('head');

0 commit comments

Comments
 (0)