rsnext/packages/next/client/dev/fouc.js
Joe Haddad af82f322e5
Enable New CSS Support by Default (#9927)
* Enable New CSS Support by Default

* Adjust configs

* Fix invisible AMP body

* Fix AMP validation warning

* test fix

* Use expression that won't be eliminated by babel
2020-01-09 15:31:28 -05:00

14 lines
453 B
JavaScript

export function displayContent() {
// This is the fallback helper that removes Next.js' no-FOUC styles when
// CSS mode is enabled. This only really activates if you haven't created
// _any_ styles in your application yet.
;(window.requestAnimationFrame || setTimeout)(function() {
for (
var x = document.querySelectorAll('[data-next-hide-fouc]'), i = x.length;
i--;
) {
x[i].parentNode.removeChild(x[i])
}
})
}