Open
Description
Description (*)
Modern HTML5 CSS and JS assets come with attributes like crossorigin
and perhaps from CDNs.
addJs()
andgetCssJsHtml()
:- Support for external URLs (https://github.com/netzkollektiv/Magento_InchooXternal) like from CDNs
- Add
integrity
,crossorigin
,referrerpolicy
attributes, maybe more? Maybe arbitrary attributes? - Support
preload
for CSS,async
,defer
,module
for JS
It's vital that CSS is above JS in the <head>
, but if you're really going for it, more control is needed: https://speakerdeck.com/csswizardry/get-your-head-straight?slide=39. But as a start, getCssJsHtml()
could accept an argument to either ouput CSS or JS, or new methods could be added that do the same thing (getJsHtml()
, getCssHtml()
). That way, the designer can put custom code between CSS and JS in head.phtml
.