As you suspected, your custom _theme.less file is overriding the _theme.less file for luma. The most obvious indicator of overriding luma's _theme.less file are the smaller icons. If you look in
pub/static/frontend/NAMESPACE/THEME/LOCALE/css/source/_theme.less
you will see your custom file instead of the one luma uses. You will see at the bottom of 'styles-l.less' and 'styles-m.less' the @import directive for 'source/_theme.less'. When you add your own custom less file in the source directory of your theme you will need to add your own import directive to these two files for the less compiler to know they exist. Then delete the entire pub/static/frontend directory and /var/view_preprocessed directory and clear your cache using bin/magento cache:flush. You will also want to make sure you are in developer mode so these static files will be regenerated on demand when you load new pages in your browser. You will also want to be sure to use grunt to recompile all your less files to add them to the pub/static/frontend directory. Otherwise you will only see .css files.
You may need to create symlinks to the less files in pub if you find your changes made in your theme directory are not persisting to the pub directory. If you only want to extend the theme with a few modifications the styles-l.less and styles-m.less files already include an import directive for the less file name _extend.less so you can add your changes in that file and your changes will modify the parent theme with no further changes.
Inchoo wrote a good article a year ago that covers much of the front end architecture works. Another great resource is the Magento Developer Documentation
Lets us create a child theme so our all custom themes in Magento 2 goes here:
app/design/frontend/company_name/theme_name
Let us assume, our company name is mycompany and our theme name is basic. We need to create following directory structure for our theme:
<app>
<design>
<frontend>
<mycompany>
<basic>
<etc>
<Magento_Theme>
<layout>
default.xml
<media>
preview.png
<web>
<css>
<fonts>
<images>
<js>
theme.xml
registration.php
mycompany :-
The name of the theme package
basic :-
The name of the theme. We can have multiple named themes inside the mycompany folder.
etc/view.xml :-
This file is used to specify product image dimensions, thumbnails etc.
Magento_Theme :-
This directory is used to override existing Magento’s theme files.
Magento_Theme/layout/default.xml :-
By default Magento2 assumes that your theme’s logo file should be: /web/media/logo.svg
If you want some other file for logo, then you must declare it in default.xml
file.
This file is also used to override default theme’s settings.
media/preview.png :-
The preview of current theme.
web :-
This directory contains all the theme’s static data like images, styles, javascript, fonts etc.
registration.php :-
This file is required to register our theme to Magento2 system.
theme.xml :-
This is a compulsory file that defines our theme name, its parent and optionally theme’s preview image.
Creating theme files
Let us now create our files one by one.
theme.xml ( app/design/frontend/mycompany/basic/theme.xml )
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Basic</title> <!-- your theme's name -->
<parent>Magento/blank</parent> <!-- the parent theme -->
<media>
<preview_image>media/preview.jpg</preview_image> <!-- theme's preview image -->
</media>
</theme>
registration.php ( app/design/frontend/mycompany/basic/registration.php )
<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::THEME,
'frontend/mycompany/basic',
__DIR__
);
default.xml ( app/design/frontend/mycompany/basic/Magento_Theme/layout/default.xml )
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="logo">
<arguments>
<argument name="logo_file" xsi:type="string">images/my_logo.png</argument>
<argument name="logo_img_width" xsi:type="number">200</argument>
<argument name="logo_img_height" xsi:type="number">200</argument>
</arguments>
</referenceBlock>
</body>
</page>
At this point, our theme is ready. Clear your cache and we will now select our new theme from admin.
Now, login to admin and move to following path:
Content -> Design -> Themes
You should see your theme listed.
Now go to:
Stores -> Configuration -> Design
Choose Main Website in front of Store View at top left. Now click
Desgin -> Design Theme
Uncheck Use Default checkbox and pick your theme. Click Save Config, clear your cache and your new theme is ready. Check your home page.
For more detail see here.
Best Answer
The problem was my theme had a parent before but it was removed later.
Flushing cache and removing the static and generation files did not work.
In the theme table of the database the parent was still set to id 1 which is magento/blank. Set the field to NULL and all started working as expected. ......