Based on the example from Google's PageSpeed Insights recommendation on optimising CSS delivery. Modified to be more robust and work in older browsers.
- Include the code in at the bottom of your HTML like Google's example.
- Make a server-side list of CSS files to defer.
- Convert that list, if it isn't already, to be a series of
styles.push( '/path/to/style.css' );
in a single string. - Output that string in place of
//DEFERRED_STYLES
in your final HTML output.