- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2021
11:39 PM
11-10-2021
11:39 PM
How to load CSS with rel="preload" attribute?
Hello, i have imported my css file like this in layout:
<css src="Mymodule_CustomModule::css/slick.css" />
but i want it to add rel="preload" attribute too, is it possible in magento 2? i searched everywhere but didn't found any solution :/
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2021
07:20 PM
12-15-2021
07:20 PM
Re: How to load CSS with rel="preload" attribute?
As of Magento 2.3.3 this can be achieved with the <font> head type.
Documentation: https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/css-topics/using-fonts.html#font-head-typ...
Reference implementation (from Luma):
https://github.com/magento/magento2/blob/2.3.6/app/design/frontend/Magento/luma/Magento_Theme/layout...5
If issue solved, Click Kudos & Accept as Solution.
LitCommerce - The Most Simple & Affordable Multi-channel Selling Tool
LitCommerce - The Most Simple & Affordable Multi-channel Selling Tool