-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There should be a new additional head block #321
Comments
Hi @in-session. Thank you for your report. Please, add a comment to assign the issue:
|
Why do you need customise it in root template. Default it's added via layout in theme module + viewModel |
Yes that's right, it was perhaps not quite explicitly expressed. As an example if you want to build critical yourself, I have in the case all CSS of modules and styles manually moved via a template in the non-critical area before.body.end (or reloaded via loadCss). So that only the default style.less is in the header. But at the first request of the page style-m.css is loaded, if you work here with _extend.less the CSS are added one after the other. Accordingly, half the of CSS must be loaded first to render the page. Is there currently no possibility to simply insert critical inline styles before the actual CSS or even other critical parts. If you work with different domains for images and static files there is also no option to insert a Also I wonder why the first request of the css must be the calendar in the Luma theme |
Default magento don't have such task (grunt/gulp) for build critical you have to do it with your own tools. It's would better if this task support by default feature included in codebase
This file maybe added via layout and available in all pages. Keep in mind css order loaded in magento 2 will be difference than magento 1. You maybe experience order not work follow that you expected
This feature not available but i already see new PR to cobebase update allow use href in link tag from layout. Previously |
Yes the generation of the critical css must be done via a tool or manually, like:
Yes that's true, but let's assume you don't want to move the CSS, but still want to have critical styles inline before that is not possible without a custom module. Sorry I don't have a demo instance available right now, so I tried to copy it together (yellow markers): Partially, the CSS is very large depending on what modules you have, in my case 200kb. In this case 90.3% of the CSS is not needed for rendering but already downloaded. Specifying the critical css here before the request to the css files effectively affects the Time to First Draw (TTFD).
That's right the correct sorting of CSS is unfortunately impossible
Ok thanks for the information, but that would not bring much if own metadata should be in front (red marker on the first image) |
default magento css not well-optimize as my opinion but if you want more than that you can take a look at theme |
Thanks for the info I already know magesuite :-) And it is actually also about building an own theme and to give here the possibility of optimization without the extends of controllers or on the access of third themes. |
Hello together,
there should be a way to call a critical block in the head, as an example head.critical, similar to head.additional
For what would this block:
There is no way to customize it via the root template:
The text was updated successfully, but these errors were encountered: