Is there a problem that needs an urgent fix?Urgent fix?Get emergency help →
Blog

Practical Magento 2 guides on upgrades, security, speed and migration, written by the MageBooster team.

Your own free Magento theme: a Luma child theme per store view (Lesson 9)

A Magento 2.4.9 Luma child theme step by step: theme.xml, registration.php, view.xml, LESS with brand colours, your own logo, a template override, the static content deploy, and a different theme per store view.
Lesson 9MageBooster Lessons · Magento 2.4.9

Your own free Magento theme: a Luma child theme per store view

A Luma child theme with your own logo, colours, font and one template, made in eight small files, registered and deployed in production mode, then used on one store view while another store view keeps a different theme. Free, no licence key, no Node.js.

Updated October 2026Video about 7 minLevel Store owners and developers

Downloads

Every file of the theme from the video. Put them in app/design/frontend/MageBooster/demo/ with the same sub-folders (the path is under each name).

What a theme is

A Magento theme is a set of layouts, templates, styles and images, and themes inherit from each other:

ThemeWhat it is
Magento/blankThe base theme: plain, meant to build on.
Magento/lumaA child of Blank: the default look of Magento 2.
MageBooster/demoOur child of Luma: only the files we change.

Fallback: for every file, Magento looks in MageBooster/demo first, then Magento/luma, then Magento/blank, then the module. The first file found wins. So a child theme stays small, and Luma updates still reach it.

The theme folder

app/design/frontend/MageBooster/demo/
  theme.xml
  registration.php
  composer.json
  etc/view.xml
  web/css/source/_extend.less
  web/images/logo.svg
  Magento_Theme/layout/default.xml
  Magento_Theme/templates/html/copyright.phtml

# as the magento user, in the Magento folder
cd /var/www/magento
mkdir -p app/design/frontend/MageBooster/demo && cd app/design/frontend/MageBooster/demo
mkdir -p etc web/css/source web/images Magento_Theme/layout Magento_Theme/templates/html
# ... create the files below, then the image sizes: copy Luma's view.xml and change one size
cp /var/www/magento/vendor/magento/theme-frontend-luma/etc/view.xml etc/
sed -i '/"category_page_grid"/,/<\/image>/{s/<width>240/<width>270/;s/<height>300/<height>338/}' etc/view.xml
grep -A3 '"category_page_grid"' etc/view.xml

The files

theme.xmlDownload

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>MageBooster demo</title>
    <parent>Magento/luma</parent>
</theme>

theme.xml: The title in the admin and the parent theme.

registration.phpDownload

<?php
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::THEME, 'frontend/MageBooster/demo', __DIR__);

registration.php: Registers the folder as the theme frontend/MageBooster/demo.

composer.jsonDownload

{
    "name": "magebooster/theme-frontend-demo",
    "description": "MageBooster demo: a Luma child theme",
    "type": "magento2-theme",
    "license": "MIT",
    "require": { "magento/theme-frontend-luma": "*" },
    "autoload": { "files": ["registration.php"] }
}

composer.json: Only used when you ship the theme as a Composer package; harmless otherwise.

_extend.lessDownload

// MageBooster demo: brand colours and a font, on top of Luma
@mb-dark: #160040;
@mb-accent: #79018C;
@font-family-name__base: system-ui;

& when (@media-common = true) {
    .page-wrapper .page-header .panel.wrapper, .page-wrapper .page-footer, .copyright { background: @mb-dark; color: #fff; }
    .panel.header .header.links a, .page-footer a, .page-footer .switcher .label { color: #fff !important; }
    .action.primary { background: @mb-accent; border-color: @mb-accent; }
    .action.primary:hover, .action.primary:focus { background: @mb-dark; border-color: @mb-dark; }
    a, .breadcrumbs a, .product-item-link { color: @mb-accent; }
}
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
    .page-wrapper .nav-sections, .navigation { background: @mb-accent; }
    .navigation .level0 > .level-top { color: #fff !important; border-color: #fff !important; }
}

web/css/source/_extend.less: Added on top of Luma's styles. system-ui is the visitor's own system font: no font files, no request to Google.

logo.svgDownload

<svg xmlns="http://www.w3.org/2000/svg" width="260" height="48" viewBox="0 0 260 48">
  <style>text { font: 700 20px system-ui, Arial, sans-serif; }</style>
  <rect width="48" height="48" rx="11" fill="#79018C"/>
  <text x="24" y="31" text-anchor="middle" fill="#fff">MB</text>
  <text x="60" y="31" fill="#160040">MageBooster demo</text>
</svg>

web/images/logo.svg: Same path as Luma's logo, so fallback picks ours.

default.xmlDownload

<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_width" xsi:type="number">260</argument>
                <argument name="logo_height" xsi:type="number">48</argument>
            </arguments>
        </referenceBlock>
    </body>
</page>

Magento_Theme/layout/default.xml: The logo's width and height, so the header does not jump while the page loads.

copyright.phtmlDownload

<?php /** @var \Magento\Framework\Escaper $escaper */ ?>
<small class="copyright">
    <span>&copy; <?= date('Y') ?> MageBooster demo &middot; <?= $escaper->escapeHtml(__('Built on a Luma child theme')) ?></span>
</small>

Magento_Theme/templates/html/copyright.phtml: Overrides the footer copyright template of the Magento_Theme module.

etc/view.xml holds the image sizes. A child theme's view.xml replaces the parent's (it is not merged), so copy Luma's file and change what you need, as in the commands above (the category grid images become 270 × 338).

Registering and deploying

setup:upgrade registers the theme. No PHP classes were added, so --keep-generated keeps the compiled code. In production mode the styles come from pub/static: deploy the theme. Luma's LESS is compiled by PHP during the deploy, so no Node.js is needed.

cd /var/www/magento
bin/magento setup:upgrade --keep-generated
bin/magento setup:static-content:deploy -f --area frontend --theme MageBooster/demo en_US
# after assigning the theme in Content > Design > Configuration
bin/magento cache:flush

A theme per store view

  1. Content › Design › Configuration: one row for Global, one per website, one per store view. A theme set on a row is inherited by the rows below it, unless they have their own.
  2. Default Store View › Edit › Applied Theme: MageBooster demo. Other Settings › HTML Head › Favicon Icon › Upload (JPG, GIF, PNG, ICO or APNG). Save Configuration.
  3. German › Edit › Applied Theme: Magento Blank. Header › Logo Image › Upload (JPG, GIF or PNG), Logo Attribute Width 260, Height 48. A logo uploaded here wins over the theme's logo.svg. Save Configuration.
  4. Flush the cache.
Website level: set the theme on the website row, and every store view of that website inherits it, unless a store view has its own.

The same from the command line:

# the same assignment from the command line (theme ids: SELECT theme_id, theme_path FROM theme;)
bin/magento config:set --scope=stores --scope-code=default design/theme/theme_id 4
bin/magento config:set --scope=stores --scope-code=de design/theme/theme_id 1
bin/magento indexer:reindex design_config_grid
bin/magento cache:flush

The result

Default Store ViewGerman
ThemeMageBooster demo (Luma child)Magento Blank
Logoweb/images/logo.svg from the themeuploaded in the admin
Colours and fontdark purple bar and footer, purple menu, buttons and links, system-uiBlank defaults
Faviconuploaded in the adminMagento default
Footer copyrightour templatethe standard one

And Hyvä?

Hyvä is a popular, faster frontend theme. It is free too, but it needs a (free) key from hyva.io and some extensions need compatibility modules. It gets its own lesson later in this course.

Troubleshooting

SymptomCause and fix
The theme is not in the Applied Theme listregistration.php or theme.xml has a typo, or setup:upgrade was not run.
Changes to a theme file do not showOld copies in pub/static and var/view_preprocessed: remove them and deploy again (below), then flush the cache.
The page has no styles at allThe theme was not deployed for that locale. Deploy it with the store view's locale (here en_US).
Product images lost their sizesA partial etc/view.xml: it replaces Luma's. Start from a full copy of Luma's file.
The logo upload is refusedThe Logo Image field takes JPG, GIF or PNG only. An SVG logo goes into the theme as web/images/logo.svg.

# changed a theme file later? remove the old copies first, otherwise they stay
cd /var/www/magento
rm -rf pub/static/frontend/MageBooster var/view_preprocessed/pub/static/frontend/MageBooster
bin/magento setup:static-content:deploy -f --area frontend --theme MageBooster/demo en_US
bin/magento cache:flush

Next lesson

Lesson 10: products. A simple and a configurable product, values per store view, and SEO.

Want your own Magento theme?We build and maintain Luma and Hyvä themes for Magento and Mage-OS stores.

▶ Watch every MageBooster lesson on YouTube: all lessons in order · subscribe to the channel

Installation guides: Magento 2.4.9 on Ubuntu Mage-OS Hyvä
Spotted a mistake on this page? Tell us and we will fix it right away.

Free Site Audit

Send your store details. We check speed, security and extensions, then reply with three quick wins within 3 working days.

Let's talk

Get a quote

Tell us about your store and we’ll reply within one working day. Prefer to chat? Say hello from WhatsApp

MageBooster Book a UnoPim demo See UnoPim live with products like yours. A new PIM or a move from Akeneo: we reply with a plan, a timeline and a quote.
✓ Official UnoPim partner✓ AI agent set up for your team✓ Connected to Magento
MageBooster Start your Hyvä project From scratch or from your current store. We reply with a project plan, a timeline and a quote.
✓ Design and structure by us✓ Hyvä-optimised server✓ Bonus modules included

MageBooster

Let us get in touch with you

Leave your details and your store address. We look at your store first and contact you within one business day, by phone, WhatsApp or email, whichever you prefer.

Partner with us