I want to lazy load this base.css or use defer how do i do that? and also is it fine to use lazyload or defer in base.css
this is the file am talking about : https://cdn.shopify.com/s/files/1/0701/4917/7646/t/16/assets/base.css?v=831047894957930821679499681
any reply would be appreciated!!
1 Like
Hi @Aasif007
I hope you are doing good and welcome to the Shopify Community!
I am San from MS Web Designer.
Use Defer this way-
Regards,
San
I think the formula you gave me was right but for now itâs not working still blocking the rander
I put it in bottom of base.css in this way.
Hello @Aasif007
Here is some description that has been added please refer to this as it might be helpful to you:
Eliminating Render-Blocking CSS-- The CSS needed to render the above-the-fold sections of the page should be delivered inline in the HTML(Critical CSS).
- The browser only pulls in the stylesheets for the device type when you add media attributes to CSS links.
Example:
The Preload Attribute for Critical Resources
<``link rel=â``stylesheetâ``href="/css``/style.css"``>
After Apply Preload
<``link rel =â``preloadâ`` href=â``/css/style.``cssâ``as=âstyleâ``onload=âthis.rel=``âstylesheetââ``>
@INA_MSWEB Itâs showing is header like this

@oscprofessional I think youâre right I have to extracts the necessary css for above the fold content
this is the orignal css link in html file theme.liquid
{{ âbase.cssâ | asset_url | stylesheet_tag }}
I tried your Apply Preload code and I think am doin it wrong.
do you have any idea how do i replace this
{{ âbase.cssâ | asset_url | stylesheet_tag }}
With this
<``link rel =â``preloadâ`` href=â``/css/style.``cssâ``as=âstyleâ``onload=âthis.rel=``âstylesheetââ``>
thanku.