cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.4 Critical CSS enabled, 3rd party icons missing

Magento 2.4 Critical CSS enabled, 3rd party icons missing

I am trying to optimize my M2.4 site by enabling Critical CSS, but I am running into an issue that I can't seem to resolve.

I am using Google Material icons throughout the site which works as intended, until I enable critical css. When enabled, the icons disappear and I only get the text value of the icons.

I have confirmed that the critical.css file exists and is getting written to the head of the page code. I have tried importing the icons via default_head_blocks.xml and also in css using @import. Neither method seems to work when critical css is enabled.

 

Hopefully one of you can suggest a fix here. I'd really like to introduce this option to speed-up the site.  Let me know if any further info is needed.

 

Thanks for any suggestions!

 

Screen Shot 2023-01-12 at 8.47.35 AM.pngScreen Shot 2023-01-12 at 8.41.30 AM.png

2 REPLIES 2

Re: Magento 2.4 Critical CSS enabled, 3rd party icons missing

I've got the same issue, man

Re: Magento 2.4 Critical CSS enabled, 3rd party icons missing

I dealt with a similar hiccup on my Magento site. Try adding your icon styles directly into the critical.css file instead of importing them separately. Also, you can use vector svg generator to make icons faster. Good luck!