Apply an Admin theme
What's in this topic
This topic describes how to apply your custom theme for Magento Admin .
- Set your Magento application to the developer mode. The application mode influences the way static files are cached by Magento.
- Create a custom theme for the Admin panel.
- Add a new custom module or decide to use existing custom module. The module must load after the Magento_Theme module. To ensure this, add the following code in
<your_custom_module_dir>/etc/module.xml(replace placeholders with your module information):
If you choose to create a separate dedicated module, you can use the Magento_SampleMinimal module from the Magento 2 sample modules repository as example of a minimal module you need. If you will copy and use Magento_SampleMinimal, do not forget to enter your vendor and module naming, instead the ones used in the sample, in the
<your_module_dir>/composer.json files .
If you decide to use the existing module, keep in mind, that theme declaring might be affected when the module is changed.
Apply a custom theme in Admin: Overview
To apply the Admin theme, take the following steps:
- Specify the new Admin theme in your module’s
- Update the components by running the
- Open the Admin in browser and view the new theme applied.
Each step is described further with more details.
Specify the custom Admin theme in
You need to specify the admin theme to be used in the
<your_module_dir>/etc/adminhtml/di.xml file. Add it, if the file does not yet exist in your module.
<your_module_dir>/etc/adminhtml/di.xml add the following (replace the placeholders with the vendor name and theme code of your Admin theme):
Update components to actually apply the Admin theme
For your changes to take effect, you need to update Magento components. For this,
bin/magento setup:upgrade command in your command line. If prompted, also run
For details about performing command line tasks, view the following topics:
Open Admin in browser
The last step is to open the Admin in browser and view the new theme applied.