#81223includeCSS.forceInline property
Description
The attached patch adds a property ‘.forceInline’ to ‘page.includeCSS’.
If ‘.forceInline’ is set, the contentd of the css-file is inlined using <style>-tags.</p>
<p>Under certain conditions, inlining some CSS can improve frontend performance. <br />It can also help making the Google PageSpeedTest happy. <br />(see <a href="https://developers.google.com/speed/docs/insights/OptimizeCSSDelivery" target="_blank" rel="noreferrer">https://developers.google.com/speed/docs/insights/OptimizeCSSDelivery</a>)</p>
<p>Example:</p>
<p>
page.includeCSS {
inline = EXT:test/Resources/Public/Css/inline.css
inline {
forceInline = 1
forceOnTop = 1
media = all
}
other = EXT:test/Resources/Public/Css/other.css
}</p>
<p>Some notes on the attached implementation:</p>
<p>External files are not inlined.<br />The inline-css is compressed if config.compressCss is set.<br />Most other properties (.allWrap, .disableCompression, .forceOnTop, .if, .media, .title) work even if ‘.forceInline’ is set. <br />If ‘.import’ and ‘.forceInline’ are both set , the file is loaded via @import. <br />The feature could be added to ‘includeCSSLibs’ too (but I don’t understand the purpose of ‘includeCSSLibs’ at all).<br />Documentation changes are not included.</p></style>