Skip to content

Commit

Permalink
blunt anti-FOUC measures
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott J. Miles committed May 21, 2013
1 parent f28bab8 commit 6fc9b8c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ document.write('<meta name="viewport" content="initial-scale=1.0, maximum-scale=

// FOUC prevention tactic
document.write('<!-- injected FOUC prevention -->\n');
document.write('<style>body {opacity: 0;}</style>');
document.write('<style>body {opacity: 0;};</style>');

// done with write
document.write('<!-- end Polymer injections -->\n');

window.addEventListener('WebComponentsReady', function() {
document.body.style.webkitTransition = 'opacity 0.3s';
document.body.style.opacity = 1;
setTimeout(function() {
document.body.style.webkitTransition = 'opacity 0.3s';
document.body.style.opacity = 1;
}, 400);
});

})();
1 change: 1 addition & 0 deletions src/shimStyling.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ var stylizer = {
stylizer.shimPolyfillDirectives(element.styles, name);
// find styles and apply shimming...
stylizer.applyShimming(stylizer.stylesForElement(element), name);
stylizer.apply();
}
},
// Shim styles to be placed inside a shadowRoot.
Expand Down

0 comments on commit 6fc9b8c

Please sign in to comment.