Magento 2: Create Custom Theme

In this post, we can see that how we create easily custom theme into Magento2.

Please follow the given below steps to create a custom theme:

1- Create Vendor & Theme folder:

Go into app/design/frontend and create vendor folder & then theme folder.
In this example, Vendor = BrijeshTech and Theme = Custom
So here, we can reach into theme folder into given below path.

app/design/frontend/BrijeshTech/Custom

2- Create Theme File:
Now create theme.xml file into theme folder. So now theme file path and theme file content are given  below:

app/design/frontend/BrijeshTech/Custom/theme.xml
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>BrijeshTech Custom Theme</title>
    <parent>Magento/luma</parent>
    <media>
         <preview_image>media/preview.jpg</preview_image>
    </media>
</theme>

3- Create Composer File:
Now   create  the composer.json file into the theme folder. So now composer file path and file content are given below:

app/design/frontend/BrijeshTech/Custom/composer.json
{
    "name": "brijeshtech/custom",
    "description": "N/A",
    "require": {
        "php": "~5.5.0|~5.6.0|~7.0.0",
        "magento/theme-frontend-luma": "~100.0",
        "magento/framework": "~100.0"
    },
    "type": "magento2-theme",
    "version": "1.0.0",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "autoload": {
        "files": [ "registration.php" ]
    }
}

4- Create Registration File:
Now   create  the registration.php file into the theme folder. So now composer file path and file content are given below:

app/design/frontend/BrijeshTech/Custom/registration.php
<?php
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
 
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'frontend/BrijeshTech/Custom',
    __DIR__
);

5-  Create Media Folder:

Now create a media folder into theme folder and put   there preview.jpg file.

app/design/frontend/BrijeshTech/Custom/media/preview.jpg

 

2 Replies to “Magento 2: Create Custom Theme”

Leave a Reply

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