Is it possible to add "rel=preload" for all the core Magento CSS files?

I have added that for my custom CSS file.

how can this be added to all the core CSS files for Magento 2.4

1 Answer 1


You can enable it via admin panel Stores > Settings > Configuration > ADVANCED > Developer or via terminal.

Magento 2.4 critical css

bin/magento config:set dev/css/use_css_critical_path 1

How to use it

You can create a critical.css in your custom theme as the example below.


Reference: Magento 2.4 DevDocs - CSS critical path

  • Is this for core css files? i have already made the custom css file Commented Nov 26, 2021 at 11:29
  • for all css..... Commented Nov 26, 2021 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.