Type
magento2-module
Magento 2 module that allows loading of stylesheets with the preload attribute
magento2-module
Commercial
None
None
None
None
None
Simple module that allows for asynchronous CSS loading in Magento 2
composer require meanbee/magento2-csspreload
A Docker development environment is included with the project:
docker-compose run --rm cli magento-extension-installer Meanbee_CSSPreload
docker-compose up -d
<referenceBlock name="head.csspreload">
<arguments>
<argument name="assets" xsi:type="array">
<item name="unique_name" xsi:type="array">
<item name="path" xsi:type="string">css/filename.css</item>
<item name="attributes" xsi:type="array">
<item name="name" xsi:type="string">attribute</item>
<item name="value" xsi:type="string">value</item>
</item>
</item>
</item>
</argument>
</arguments>
</referenceBlock>