I want to load a custom css file for the admin panel from a custom module folder.

My layout xml file looks like this

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <css src="Vendor_Module::test.css" />

I've also tried

    <css src="Vendor_Module::css/test.css" />

I tried putting the file in




After each I cleared the cache, the page cache and the pub/static folder.

The css file is not loading. Does anyone know why ?

  • 1
    Assuming that your module is enabled, try running bin/magento setup:upgrade Feb 23, 2016 at 12:49
  • that worked... so php bin/magento setup:static-content:deploy is not enough.... do I have to run setup:upgrade every time i add new js or css file to a module ? Feb 23, 2016 at 13:08
  • I'm not sure, but bin/magento setup:upgrade always seem to solve my issue Feb 23, 2016 at 13:12
  • ok, 10x. one more question. When I write in a js file from a certain module, I always have to clear pub/static and regenerate full static content so I can check what I've done, how can I escape that on development mode ? Feb 23, 2016 at 13:14
  • According to devdocs.magento.com/guides/v2.0/config-guide/bootstrap/… development mode should not cache those files Feb 23, 2016 at 13:17

1 Answer 1


Assuming that your module is enabled and configured correctly


bin/magento setup:upgrade

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.