Is there any configuration that makes style section loaded like this in head tag:

<style data-href="http://www.website.com/pub/static/frontend/Mytheme/mytheme/fr_FR/mage/calendar.css" media="all"> ....</style>

Instead of like this:

<link rel="stylesheet" type="text/css" media="all" href="www.website.com/pub/static/frontend/Mytheme/mytheme/fr_FR/mage/calendar.css" />

In fact, I want it to be a link tag like by default, but maybe a configuration makes it changed to inline style tag, and I can not find what configuration has been changed.

  • Did you miss something in your question ?
    – MGento
    Oct 11, 2017 at 15:38
  • Solved, it was a custom js file that makes it happen, it was not configuration
    – Mirindra
    Oct 12, 2017 at 13:15

1 Answer 1


Yes, possiable, Just go to Magento\Framework\View\Page\Config\Renderer

at function getAssetTemplate()

protected function getAssetTemplate($contentType, $attributes)
    switch ($contentType) {
        case 'js':
            $groupTemplate = '<script ' . $attributes . ' src="%s"></script>' . "\n";

        case 'css':
            $groupTemplate = '<link ' . $attributes . ' href="%s" />' . "\n";
    return $groupTemplate;

You need to modify* from link to **style`**

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.