Use custom variable in html.tpl.php for critical css I have built my current theme in my D7 site upon the Foundation theme, and with that comes a LOT of unused CSS that gives me a low score in Pagespeed Insights. I have tried different things, among others to use the Advagg module and it's submodule "Critical CSS". These modules does no good for my site unfortunately, despite repeated trials and despite safe settings etc. The screen goes blank and/or each page takes minutes to load. When I only use safe settings and critical css, the page speed score does not improve (and yes, all settings are done according to docs and I have spent many hours on trialling without luck).

So, instead I thought I would try to move this row in html.tpl.php:

    &lt;?php print $styles; ?&gt;
&lt;/body&gt;


...to the bottom of the page just before the ending body tag. Then I would need to add the critical css in the head section. 

    &lt;head&gt;
        &lt;?php print $critical_css; ?&gt;
...


But how can I pass a variable like $critical_css to html.tpl.php, that only contains the just necessary to show the page? Or is this not possible?
Instructions for the Critical CSS module:

Navigate to: admin/config/development/performance/advagg/critical-css

Under Add Critical CSS
- Select the theme that is your front page; usually the default is correct.
- User type should be set to 'anonymous' under most circumstances.
- Type of lookup, select URL
- Value to lookup, type in 
- Critical CSS, paste in the generated CSS from running your homepage url
through https://www.sitelocity.com/critical-path-css-generator which is inside
of the 'Critical Path CSS' textarea on the sitelocity page.
- Click Save Configuration.