Feature #81223
closedincludeCSS.forceInline property
100%
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.
Under certain conditions, inlining some CSS can improve frontend performance.
It can also help making the Google PageSpeedTest happy.
(see https://developers.google.com/speed/docs/insights/OptimizeCSSDelivery)
Example:
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 }
Some notes on the attached implementation:
External files are not inlined.
The inline-css is compressed if config.compressCss is set.
Most other properties (.allWrap, .disableCompression, .forceOnTop, .if, .media, .title) work even if '.forceInline' is set.
If '.import' and '.forceInline' are both set , the file is loaded via @import.
The feature could be added to 'includeCSSLibs' too (but I don't understand the purpose of 'includeCSSLibs' at all).
Documentation changes are not included.
Files
Updated by Raphael Graf over 7 years ago
- File forceInline-v2.patch forceInline-v2.patch added
The original patch had a problem related to concatenation of the css-files.
Here is a better version.
Updated by Simon Schaufelberger over 7 years ago
- Subject changed from includeCSS .forceInline property to includeCSS.forceInline property
Hi Raphael,
Thank you for your patch. Could you please push your change to our review system?
https://docs.typo3.org/typo3cms/ContributionWorkflowGuide/
Thank you very much!
Updated by Gerrit Code Review over 7 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53077
Updated by Gerrit Code Review over 7 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53077
Updated by Gerrit Code Review over 7 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53077
Updated by Gerrit Code Review over 7 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53077
Updated by Gerrit Code Review over 7 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53077
Updated by Gerrit Code Review over 7 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53077
Updated by Gerrit Code Review over 7 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53077
Updated by Gerrit Code Review over 7 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53077
Updated by Gerrit Code Review over 7 years ago
Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53077
Updated by Raphael Graf over 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 2d0d401f3dafcd388741f8a2b739068859b1d2be.