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

Commit ea2ff2d

Browse files
author
Scott J. Miles
committed
include a default transition for body opacity (which we never clean up)
1 parent 4adcc86 commit ea2ff2d

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/unresolved.js

+10-5
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,23 @@
44
* license that can be found in the LICENSE file.
55
*/
66
(function(scope) {
7-
7+
88
// TODO(sorvell): It's desireable to provide a default stylesheet
99
// that's convenient for styling unresolved elements, but
1010
// it's cumbersome to have to include this manually in every page.
1111
// It would make sense to put inside some HTMLImport but
1212
// the HTMLImports polyfill does not allow loading of stylesheets
1313
// that block rendering. Therefore this injection is tolerated here.
14-
var UNRESOLVED = 'unresolved';
15-
var UNRESOLVED_SELECTOR = 'body[' + UNRESOLVED + ']';
14+
1615
var style = document.createElement('style');
17-
style.textContent = UNRESOLVED_SELECTOR + ' { ' +
18-
'opacity: 0; display: block; overflow: hidden; } \n';
16+
style.textContent = ''
17+
+ 'body {'
18+
+ 'transition: opacity ease-in 0.2s;'
19+
+ ' } \n'
20+
+ 'body[unresolved] {'
21+
+ 'opacity: 0; display: block; overflow: hidden;'
22+
+ ' } \n'
23+
;
1924
var head = document.querySelector('head');
2025
head.insertBefore(style, head.firstChild);
2126

0 commit comments

Comments
 (0)