1

By following other tickets and documentation. I have been able to see new custom theme in admin section based on the next steps:

Here the steps I have done:

  1. I have created folder structure under 'Magentoroot'/app/design/frontend/myvendor/mytheme/

Folders structure .

  1. Then I have added file: 'theme_dir'/theme.xml
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
     <title>My Theme</title> <!-- your theme's name -->
     <parent>Magento/blank</parent> <!-- the parent theme, in case your theme inherits from an existing theme -->
     <media>
         <preview_image>media/preview.jpg</preview_image> <!-- the path to your theme's preview image -->
     </media>
 </theme>

.

  1. Then I have added file: 'theme_dir'/composer.json
{
    "name": "myvendor/theme-frontend-mytheme",
    "description": "N/A",
    "require": {
        "php": "~5.5.0|~5.6.0|~7.0.0",
        "magento/theme-frontend-blank": "100.0.*",
        "magento/framework": "100.0.*"
    },
    "type": "magento2-theme",
    "version": "100.0.1",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "autoload": {
        "files": [
            "registration.php"
        ]
    } }

. 4. Then I have added file: 'theme_dir'/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/myvendor/mytheme',
    __DIR__ );

.

  1. Then I updated ''/dev/tools/grunt/configs/themes.js - just below luma:

    luma: {
        area: 'frontend',
        name: 'Magento/luma',
        locale: 'en_US',
        files: [
            'css/styles-m',
            'css/styles-l'
        ],
        dsl: 'less'
    },
    mytheme: {
        area: 'frontend',
        name: 'myvendor/mytheme',
        locale: 'en_US',
        files: [
            'css/styles-m',
            'css/styles-l'
        ],
        dsl: 'less'
    },
    

.

  1. Then deleted var from root

  2. Then I flushed cache

  3. Then I ran from CLI - in this step the new theme was not shown in logs: magento setup:static-content:deploy

  4. Then when I go to Admin/Content/Themes and I am able to find new theme.

1

you also have to use the theme in a store I think.

Goto Stores -> Configuration -> General -> Design for this

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.