How to create an Admin theme in Magento 2.4

A custom theme allows the admin to have a customized backend panel with custom logo, font, responsive design which makes it easier for the admin to administer!

1.) Create theme directory

In the app/design/adminhtml directory create a new Vendor/theme directory.


Inside theme directory create theme.xml file

<?xml version="1.0" ?>
<theme xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>M2e admin </title> <!-- your theme's name -->
<parent>Magento/backend</parent> <!-- the parent theme-->

2.) Create registration.php inside theme directory


use \Magento\Framework\Component\ComponentRegistrar;
ComponentRegistrar::register(ComponentRegistrar::THEME, 'adminhtml/M2e/dev', __DIR__);

Now we have to Apply admin theme

3.) Create custom module to apply your admin theme



use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'M2e_Dev', __DIR__);


<?xml version="1.0" ?>
<config xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="M2e_Dev"/>
<module name="Magento_Theme"/>

iii) M2e/Dev/etc/di.xml

<?xml version="1.0" ?>
<config xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Theme\Model\View\Design">
<argument name="themes" xsi:type="array">
<item name="adminhtml" xsi:type="string">M2e/dev</item>

final step install the module

php bin/magento setup:upgrade

php bin/magento setup:di:compile

One can create a custom admin theme in Magento 2 and include features like search tool, neat and clean panel arrangement, translation ready, custom colors, and much more!

Any doubts about the custom admin theme?

If so, feel free to mention them in the Comments section below.

I’d be happy to help.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *