0

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

0

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.

app/design/frontend/<your_vendor_name>/<your_theme_name>/web/css/critical.css

Reference: Magento 2.4 DevDocs - CSS critical path

2
  • 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.