1

I'm running Magento 2.1.9 on nginx 1.8.1 In Stores - Configuration - Advanced - Developer under CSS Settings I've selected:

  • Merge CSS Files: yes
  • Minify CSS Filey: no

Then I'd flush my Magento cache.

php bin/magento setup:static-content:deploy

My shop is in production mode but I still see my CSS files:

<link  rel="stylesheet" type="text/css"  media="all" href="domain.etc..Smartwave/porto/en_US/mage/calendar.css" /> 
<link  rel="stylesheet" type="text/css"  media="all" href="domain.etc..Smartwave/porto/en_US/css/styles-m.css" />
<link  rel="stylesheet" type="text/css"  media="all" href="domain.etc..Smartwave/porto/en_US/bootstrap/css/bootstrap.css" />
<link  rel="stylesheet" type="text/css"  media="all" href="domain.etc..Smartwave/porto/en_US/bootstrap/css/bootstrap-theme.css" />
<link  rel="stylesheet" type="text/css"  media="all" href="domain.etc..Smartwave/porto/en_US/owl.carousel/assets/owl.carousel.css" />

19 CSS files in total. Is it possible to merge them somehow?

4
  • Check value dev/css/merge_css_files = 1 or not in database. Oct 28, 2017 at 4:34
  • Yes, I've got that one in my db.
    – Chris
    Oct 30, 2017 at 17:43
  • Then, It is already merged. But, if dev/css/merge_css_files = 0 then it is still not merged. Oct 30, 2017 at 17:53
  • But I can see from the source code, that my css files are not merged .. that's the reason why I asked here ...
    – Chris
    Oct 30, 2017 at 20:08

1 Answer 1

0

This is because of the media="all" param. If you remove it, CSS will get merged.

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.