Modernizr in footer causing flash of no-js styles

I believe the Sage gulpfile is placing Modernizr in the footer, and as a result is causing my no-js styles to flash before replacing no-js with js. If Modernizr was in the header (per the recommended use), I don’t think this would be a problem.

Is there a way to have gulp load Modernizr in the header or an alternative way to remedy the no-js flash?

Sure, it’s a standard WP enqueue: https://github.com/roots/sage/blob/master/lib/assets.php#L75

1 Like

@kalenjohnson Thank you! I mistakenly thought gulp was handling the placement of the script.

Changing the last parameter of wp_enqueue_script to false now places Modernizr in the head, and removed the flash of no-js styles. :smile: