Installing and Setting Up Hyvä: Parent Theme, Creating Your Own Child Theme
Installing and Setting Up Hyvä: Parent Theme, Creating Your Own Child Theme
~8 Min. Lesezeit Zuletzt aktualisiert am August 9, 2026
Hyvä is never active directly "as a theme" on a page - it always works through two layers: a parent theme (Hyvä's actual core package) and your own child theme, where your project's customizations live. That's the same inheritance logic Magento themes generally use - the parent theme just happens to come from Hyvä instead of Luma.
Which parent theme variant?
Hyvä offers two variants of the default theme: hyva-themes/magento2-default-theme (without built-in CSP support) and hyva-themes/magento2-default-theme-csp. For projects that want to enforce a Content Security Policy - generally a good idea - the CSP variant is the right choice. In this tutorial, and in the mironsoft project itself, that's the parent theme:
hyva-themes/magento2-default-theme-cspAchtung: The CSP variant isn't an optional extra you can bolt on later - it determines from the start how inline scripts must be registered (see chapter 9). If you start with the non-CSP variant and switch later, you may have to retrofit every inline script in the project.
Installing via Composer
In the mironsoft project, every Composer command runs through the bin/composer wrapper instead of directly - that way the command is guaranteed to run inside the Docker container with the right PHP version. First, the Hyvä module and the CSP theme itself:
bin/composer require hyva-themes/magento2-theme-module
bin/composer require hyva-themes/magento2-default-theme-cspmagento2-theme-module brings Hyvä's own Magento modules (including the CSP integration itself), magento2-default-theme-csp is the actual parent theme with all the default templates.
Creating your own child theme
Next we create the child theme where all project-specific customizations live - in this project it lives under src/app/design/frontend/Mironsoft/default/.
Basic structure of a Hyvä child theme
app/design/frontend/Mironsoft/default/
├── registration.php
├── theme.xml
├── composer.json
└── web/
└── tailwind/
├── tailwind.config.js
├── package.json
└── src/
└── styles.css<?php
declare(strict_types=1);
use Magento\Framework\Component\ComponentRegistrar;
ComponentRegistrar::register(
ComponentRegistrar::THEME,
'frontend/Mironsoft/default',
__DIR__
);<?xml version="1.0" encoding="UTF-8"?>
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Mironsoft Default</title>
<parent>hyva-themes/default-csp</parent>
<media>
<preview_image>media/preview.jpg</preview_image>
</media>
</theme>The <parent> entry is the crucial line: it tells Magento that our theme inherits all templates, Layout XML, and base configuration from hyva-themes/default-csp, as long as we don't explicitly override anything (chapter 10 covers the override conventions in detail).
Registering and activating the theme
bin/magento cache:clean
bin/magento setup:upgrade
bin/magento config:set design/theme/theme_id 2 # ID of the new themeYou can find the actual theme ID either in the admin UI under Content > Design > Themes, or via the CLI. Alternatively, you can select the theme directly in the admin under Content > Design > Configuration for the desired store.
Tipp: Right after activating the theme, the page will still look "broken" - the built Tailwind CSS is simply missing. That's normal, and gets fixed in the next chapter once we understand the theme structure and run through the build process in chapter 5.